Can we declare function inside main?



Can we declare function inside main?..

Answer / Sharad Vishwakarma

No, you cannot directly declare a function inside the 'main()' function in C. Functions should be defined before they are called, either at the top of the program or in separate files.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C Interview Questions

write a 'c' program to sum the number of integer values

8 Answers  


#&#8206;include&#8236;<stdio.h> void main() { int i; for(i=5;0;i++) { printf("%d",i); } }

2 Answers   Facebook,


while loop contains parts a) initialisation, evalution of an expression,increment /decrement b) initialisation, increment/decrement c) condition evalution d) none of the above

1 Answers  


What are the benefits of organizational structure?

1 Answers  


Write a Program to accept different goods with the number, price and date of purchase and display them

1 Answers   HDFC,


here is a link to download Let_Us_C_-_Yashwant_Kanetkar

3 Answers   Microsoft,


Is there sort function in c?

1 Answers  


What are the types of c language?

1 Answers  


what is output? main() { #define SQR(x) x++ * ++x int i = 3; printf(" %d %d ",SQR(i),i * SQR(i)); } a)9 27 b)35 60 c)20 60 d)15 175

5 Answers   Wipro,


What is the difference between %d and %*d in C

3 Answers  


What is a memory leak in structures? How can we rectify that?

2 Answers  


write a program to input 10 strings and compare without using strcmp() function. If the character of one string matches with the characters of another string , sort them and make it a single string ??? example:- str1="Aakash" st2="Himanshu" str="Uday" output:- Aakashimanshuday (please post the answer as quickly as possible)

1 Answers   Google,


Categories