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

difference between loading and linking

1 Answers  


How to add two numbers without using semicolon n c????

3 Answers  


what is c?

7 Answers   Tech Mahindra,


What is mean by data types in c?

0 Answers  


How to explain the final year project as a fresher please answer with sample project

0 Answers  






Explain how do you list files in a directory?

0 Answers  


Why the below program throughs error during compilation? #include<stdio.h> #include<conio.h> enum { ZERO, ONE, TWO, }; main() { printf("%d",&TWO); getch(); }

2 Answers  


Write code for finding depth of tree

2 Answers   Adobe,


extern static int i func() { i =10; i++; printf("%d \n",i); } main() { i =20; printf("%d \n",i); func(); printf("%d \n",i); }

2 Answers  


write a c program to do the following: a) To find the area of a triangle. b) To convert the temperature from Fahrenheit to Celsius. c) To convert the time in hours : minutes : seconds to seconds.

0 Answers  


What is malloc and calloc?

0 Answers  


what is reason of your company position's in india no. 1.

0 Answers   Accenture, TCS,


Categories