Is main() is used in the program,,see below example?
void main()
{
int i;
for(i=0;i<10;i++)
main();
}
Then what is the output of the program?
Answers were Sorted based on User's Feedback
Answer / sai
The given program is an infinite loop with no
output.Because it calls main() function with in the for
loop.
So the value of the i always '0' only.According to the for
loop condition the execution of the program goes false only
i>=10.Then when the condition in the for loop goes to false?
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / anbu sankar
Always i value is zero.
This program comes under recusive concept.
In stack memory,always remaining statement address [(i.e)
after main]is stored.
so at one stage stack is filled by addresses. so
Segmentation falut...
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / kalyan chukka
Loop will Repeated 10 times .in this program main function
is called it self 10 times.So the loop will repeated 10 times
| Is This Answer Correct ? | 1 Yes | 4 No |
What is the best way to store flag values in a program?
Explain what is the heap?
What is switch in c?
Explain how can I manipulate strings of multibyte characters?
Why is c called a structured programming language?
How to write c functions that modify head pointer of a linked list?
Explain what is the benefit of using #define to declare a constant?
how can i access hard disk address(physical address)? are we access hard disk by using far,near or huge pointer? if yes then please explain.....
Are there constructors in c?
Meaning of () in c
How to find a missed value, if you want to store 100 values in a 99 sized array?
Tell me with an example the self-referential structure?