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

Which one would you prefer - a macro or a function?

846


What is anagram in c?

707


Why we use conio h in c?

900


Tell us the use of fflush() function in c language?

898


What is the difference between local variable and global variable in c?

923


What is static memory allocation?

848


What are valid operations on pointers?

948


How can I determine whether a machines byte order is big-endian or little-endian?

831


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 ?????? */ }

1856


write a C program:There is a mobile keypad with numbers 0-9 and alphabets on it. Take input 0f 7 keys and then form a word from the alphabets present on the keys.

15481


Do you know the difference between exit() and _exit() function in c?

810


What is default value of global variable in c?

760


Explain what are the __date__ and __time__ preprocessor commands?

866


What is %g in c?

836


What is null pointer constant?

792