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 |
What is the purpose of the following code? Is there any problem with the code? void send(int count, short *to, short *from) { /* count > 0 assumed */ register n = (count + 7) / 8; switch (count % 8) { case 0: do { *to = *from++; case 7: *to = *from++; case 6: *to = *from++; case 5: *to = *from++; case 4: *to = *from++; case 3: *to = *from++; case 2: *to = *from++; case 1: *to = *from++; } while (--n > 0); } }
how to write hello word without using semicolon at the end?
What is the difference between text and binary i/o?
What is the condition that is applied with ?: Operator?
main() {char a[10]={1,2,3,4,5,6};int x; for(x=0;x<4;x++){ b[x]=x+'a';} printf("%s",b);}
How to calculate Total working time using Login and logout?
2 Answers CTS, Cygnus, Infosys, Signal Networks, TCS, Wipro,
what is the use of bitfields & where do we use them?
1 1 1 1 2 1 1 3 3 1 1 4 6 4 1
Is struct oop?
What is the advantage of an array over individual variables?
Is it acceptable to declare/define a variable in a c header?
Can we initialize extern variable in c?