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?

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How do you convert a decimal number to its hexa-decimal equivalent.Give a C code to do the same

904


What is a spanning Tree?

1283


Can you explain what keyboard debouncing is, and where and why we us it? please give some examples

1971


How can I invoke another program or command and trap its output?

884


What is a const pointer in c?

900


void main(){ int a; a=1; while(a-->=1) while(a-->=0); printf("%d",a); }

1515


What is operator precedence?

923


What is the condition that is applied with ?: Operator?

910


Is linux written in c?

817


What is the difference between if else and switchstatement

1606


What are logical errors and how does it differ from syntax errors?

948


differentiate built-in functions and user – defined functions.

890


What are the basic data types associated with c?

1063


How many levels of indirection in pointers can you have in a single declaration?

864


provide an example of the Group by clause, when would you use this clause

1992