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 |
How to print India by nested loop? I IN IND INDI INDIA
List some of the dynamic data structures in C?
what is the output for the code : main() { int i,j; printf("%d %d ",scanf("%d%d",&i,&j)); }
write a program to find the largest and second largest integer from an array
Why is sprintf unsafe?
I use turbo C which allocates 2 bytes for integers and 4 bytes for long. I tried to declare array of size 500000 of long type using the following code... long *arr; arr=(long *)(malloc)(500000 * sizeof(long)); It gives a warning that "Conversion may lose significant digits in function main"... And the resulting array size was very less around 8400 as compared to 500000. Any suggestions will be welcomed....
can we access one file to one directory?
What is the difference between %d and %*d in C
Go through the following code sinippet char a[20]; a="Hello Orcale Test"; will this compile?
code for copying two strings with out strcpy() function.
what is difference between procedural language and functional language ?
What is use of #include in c?