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



Is main() is used in the program,,see below example? void main() { int i; for(i=0;i<10;i++)..

Answer / parvathi

it cgoes into infinite loop

Is This Answer Correct ?    11 Yes 1 No

Is main() is used in the program,,see below example? void main() { int i; for(i=0;i<10;i++)..

Answer / hari

it will go into an infinite loop.
cheers !!!

for further queries and discussions, just check these out !!!

http://forum.campusmaniac.com/
http://www.campusmaniac.com/

Is This Answer Correct ?    2 Yes 0 No

Is main() is used in the program,,see below example? void main() { int i; for(i=0;i<10;i++)..

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

Is main() is used in the program,,see below example? void main() { int i; for(i=0;i<10;i++)..

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

Is main() is used in the program,,see below example? void main() { int i; for(i=0;i<10;i++)..

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

Is main() is used in the program,,see below example? void main() { int i; for(i=0;i<10;i++)..

Answer / harshitha

the loop will be repeated for 10 times

Is This Answer Correct ?    2 Yes 12 No

Post New Answer

More C Interview Questions

progrem to generate the following series 1 12 123 1234 12345

6 Answers   HCL, Wipro,


in C-programming language without using printf statement can we get output r not ? if yes how and if no also how ?

11 Answers   IBM,


What does == mean in texting?

0 Answers  


how to swap two nubers by using a function with pointers?

1 Answers  


What is c language & why it is used?

0 Answers  






Tell me a C program to display the following Output? 1 1 1 1 1 2 2 2 2 3 3 3 4 4 5

3 Answers  


i have to apply for the rbi for the post of officers. i need to know abt the entrance questions whether it may be aps or techinical....

0 Answers   RBI,


find the size of structure without using the size of function

1 Answers   Bosch,


What is pragma c?

0 Answers  


What is the purpose of the statement: strcat (S2, S1)?

0 Answers  


Is it valid to address one element beyond the end of an array?

0 Answers  


what is the disadvantage of using macros?

1 Answers   Wipro,


Categories