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 |
#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?
What is return in c programming?
What are types of functions?
What are different storage class specifiers in c?
using for loop sum 2 number of any 4 digit number in c language
How do I get an accurate error status return from system on ms-dos?
In the DOS enveronment, normal RAM that resides beyond the 1mb mark. a) expanded memory b) swapped memory c) Extended memory d) none
Which is more efficient, a switch statement or an if else chain?
Convert the following expression to postfix and prefix X $ Y Z - M + N + P / Q / (R + S)
What is array in C
How can I display a percentage-done indication that updates itself in place, or show one of those twirling baton progress indicators?
Can the sizeof operator be used to tell the size of an array passed to a function?