- #1
fireflies
- 210
- 12
I have learned that in c programming language at least one function is needed. And the function is given as:
int main(){
//statements;
return 0;
}
Then when I turned to the function page (in a web tutorial) I saw functions are declared by return type-function name and parameters.
The questions are:
1) Should the only one function be main()? Why not writing any other name than main? Is it possible?
2) Why return type is integer here? Specially as a beginner the programming I am doing is printing, or sum, making patterns with stars, loops type.. So, why return type not void, but int? And why we are saying return 0?
int main(){
//statements;
return 0;
}
Then when I turned to the function page (in a web tutorial) I saw functions are declared by return type-function name and parameters.
The questions are:
1) Should the only one function be main()? Why not writing any other name than main? Is it possible?
2) Why return type is integer here? Specially as a beginner the programming I am doing is printing, or sum, making patterns with stars, loops type.. So, why return type not void, but int? And why we are saying return 0?