can v write main()
{
main();
}
Is it true?

Answers were Sorted based on User's Feedback



can v write main() { main(); } Is it true?..

Answer / manish soni bca 3rd year jaipu

it is recursive function.
here is no condition is apply so
the result is
infintely.
and after that 'the statck memory flow'.
conditio is start.


manish soni tagore bio tech collage,
jaipur

Is This Answer Correct ?    2 Yes 0 No

can v write main() { main(); } Is it true?..

Answer / satya

k.. but what is the result.. i want some explanation... is
not it be recurssive..

Is This Answer Correct ?    2 Yes 1 No

can v write main() { main(); } Is it true?..

Answer / sharath

yes we can write

Is This Answer Correct ?    5 Yes 5 No

can v write main() { main(); } Is it true?..

Answer / sharath

yes it becomes a recursive function
we have to specify any condition using a loop or any decision block so that the loop doesnot call the main() function again.

Is This Answer Correct ?    1 Yes 1 No

can v write main() { main(); } Is it true?..

Answer / sharath

what do you think as you oppposed the answer
can you please explain it
please..

Is This Answer Correct ?    0 Yes 0 No

can v write main() { main(); } Is it true?..

Answer / sharath

yes u are right
there is no condition and the result is an infinite loop which continues till the stack overflow after that it may hang..

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C Interview Questions

why we use "include" word before calling the header file. is there any special name for that include??????

1 Answers   TCS,


write a program of palindrome(madam=madam) using pointer?

5 Answers   L&T,


#include<stdio.h> int f(int,int); int main() { printf("%d",f(20,1)); return 0; } int f(int n,int k) { if(n==0) return 0; else if(n%2)return f(n/2,2*k)+k; else return f(n/2,2*k)-k; } how this program is working and generating output as 9....?

1 Answers  


code for find determinent of amatrix

0 Answers  


What is this pointer in c plus plus?

0 Answers  






what is the difference between arrays and linked list

26 Answers   MAHINDRA, Tech Mahindra, Wipro,


A global variable when referred to in another file is declared as this a) local variable b) external variable c) constant d) pointers

0 Answers  


How to reverse a string using a recursive function, with swapping?

5 Answers  


when i declare as: void main() { clrscr(); int a=10; printf("%d",a) } my problem that why generate a error in above programs. please tell me answer seriously .

4 Answers  


code snippet for creating a pyramids triangle ex 1 2 2 3 3 3

4 Answers  


What is the easiest sorting method to use?

0 Answers  


A text file that contains declarations used by a group of functions,programs,or users a) executable file b) header file c) obj file d) .cfile

0 Answers  


Categories