Main must be written as
a.the first function in the program
b.Second function in the program
c.Last function in the program
d.any where in the program
Answers were Sorted based on User's Feedback
Answer / swamy s t
Answer is D. any where in the program.
No matter whereever it is because the program should
starts or begins from main() function only.
| Is This Answer Correct ? | 30 Yes | 3 No |
Answer / manju
d.any where in the program
because the execution of a program begins from the main
function.it doesn't consider the place where the main
function written.
| Is This Answer Correct ? | 16 Yes | 2 No |
Answer / devvv
main function is a basic in c programming
language.generally main is written first.but when executing
modular programs ,to avoid prototyping, other functions
are written first.so main can be written anywhere in a
program.but atleast one of the other functions must be
declared in main.
| Is This Answer Correct ? | 11 Yes | 4 No |
d.any where in the program. but it should declare after the
declaration of veriable where it starts execution of the
program
| Is This Answer Correct ? | 6 Yes | 2 No |
Answer / sudipta panja
(d)--execution starts from main,i.e. compiler starts
compiling from main but the posn of main is not fixed.it can
be anywhere.
| Is This Answer Correct ? | 3 Yes | 0 No |
How can I recover the file name given an open stream?
int main() { int days; printf("enter days you are late"); scanf("%d",days); if (days<=5) printf("5o paisa fine"); if (days<=10&&days>=6) printf("1rs fine"); if(days>10) printf("10 rs fine"); if(days=30) printf("membership cancelled"); return 0; } tell me whats wrong in this program? is it right?
What is null pointer constant?
How is a macro different from a function?
What does printf does?
Why isn't any of this standardized in c? Any real program has to do some of these things.
name the language for writing c compiler?
Why we not create function inside function.
Is c is a high level language?
write a function to find whether a string is palindrome or not and how many palindrome this string contain?
Explain what is the general form of a c program?
main() { intx=2,y=6,z=6; x=y=z; printf(%d",x) }
5 Answers Amazon, HCL, Thought Works,