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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What does s c mean in text?

615


What do you mean by scope of a variable in c?

546


I was asked to write a program in c which when executed displays how many no.of clients are connected to the server.

1907


What is sizeof in c?

572


Why do we use & in c?

593






What is the difference between c and python?

586


Explain how can I make sure that my program is the only one accessing a file?

629


Can the size of an array be declared at runtime?

611


Is c++ based on c?

656


Write a C program linear.c that creates a sequence of processes with a given length. By sequence it is meant that each created process has exactly one child. Let's look at some example outputs for the program. Here the entire process sequence consists of process 18181: Sara@dell:~/OSSS$ ./linear 1 Creating process sequence of length 1. 18181 begins the sequence. An example for a sequence of length three: Sara@dell:~/OSSS$ ./linear 3 Creating process sequence of length 3. 18233 begins the sequence. 18234 is child of 18233 18235 is child of 18234 ........ this is coad .... BUt i could not compleate it .....:( #include #include #include #include int main(int argc, char *argv[]) { int N; pid_t pid; int cont; if (argc != 2) { printf("Wrong number of command-line parameters!\n"); return 1; } N = atoi(argv[1]); printf("Creating process sequence of length %d.\n",N); printf("%d begins the sequence.\n",getpid()); /* What I have to do next ?????? */ }

1621


Which node is more powerful and can handle local information processing or graphics processing?

829


Does free set pointer to null?

565


When should you not use a type cast?

661


can any one provide me the notes of data structure for ignou cs-62 paper

1707


string reverse using recursion

1812