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 math functions are available for integers? For floating point?
list the no of files created when c source file is compiled
You are given a string which contains some special characters. You also have set of special characters. You are given other string (call it as pattern string). Your job is to write a program to replace each special characters in given string by pattern string. You are not allowed to create new resulting string. You need to allocate some new memory to given existing string but constraint is you can only allocate memory one time. Allocate memory exactly what you need not more not less.
write a program to count the no of repaeted words in a line?
# define prod(a,b)=a*b main() { int x=2; int y=3; printf("%d",prod(x+2,y-10)); } the output of the program is a.8 b.6 c.7 d.none
What is scope rule of function in c?
what is the difference between call by value and call by reference?
5 Answers Genpact, Global Logic, Infosys,
What is the use of linkage in c language?
Can we compile a program without main() function?
what does exit() do?
When is a “switch” statement preferable over an “if” statement?
What is function prototype in c language?