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

#define swap1(a,b) a=a+b;b=a-b;a=a-b; main() { int x=5,y=10; swap1(x,y); printf("%d %d\n",x,y); swap2(x,y); printf("%d %d\n",x,y); } int swap2(int a,int b) { int temp; temp=a; b=a; a=temp; return; } what are the outputs?

4 Answers   Ramco,


What is return in c programming?

0 Answers  


What are types of functions?

0 Answers  


What are different storage class specifiers in c?

0 Answers  


using for loop sum 2 number of any 4 digit number in c language

0 Answers  


How do I get an accurate error status return from system on ms-dos?

0 Answers  


In the DOS enveronment, normal RAM that resides beyond the 1mb mark. a) expanded memory b) swapped memory c) Extended memory d) none

0 Answers  


Which is more efficient, a switch statement or an if else chain?

0 Answers  


Convert the following expression to postfix and prefix X $ Y Z - M + N + P / Q / (R + S)

2 Answers  


What is array in C

0 Answers  


How can I display a percentage-done indication that updates itself in place, or show one of those twirling baton progress indicators?

0 Answers  


Can the sizeof operator be used to tell the size of an array passed to a function?

0 Answers  


Categories