Write a main() program that calls this function at least 10
times. Try implementing this function in two different
ways. First, use an external variable to store the count.
Second, use a local variable. Which is more appropriate?

Answers were Sorted based on User's Feedback



Write a main() program that calls this function at least 10 times. Try implementing this function ..

Answer / banavathvishnu

main()
{
static int i;
while(i<10)
{
i++;
main();
}

}

Is This Answer Correct ?    1 Yes 0 No

Write a main() program that calls this function at least 10 times. Try implementing this function ..

Answer / satya

why not we use if instead of while in the above answer...

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C Interview Questions

What are lookup tables in c?

0 Answers  


What is omp_num_threads?

0 Answers  


How does sizeof know array size?

0 Answers  


Tell me about low level programming languages.

0 Answers   Amdocs,


How can I avoid the abort, retry, fail messages?

0 Answers  






How will you print TATA alone from TATA POWER using string copy and concate commands in C?

0 Answers   Amdocs, Apps Associates,


Why doesn't the code "int a = 1000, b = 1000; long int c = a * b;" work?

7 Answers  


What is f'n in math?

0 Answers  


How can I get the current date or time of day in a c program?

0 Answers  


wat is the difference between array and pointer?

4 Answers   Wipro,


what is the value of 'i'? i=strlen("Blue")+strlen("People")/strlen("Red")-strlen("green")

7 Answers   Cadence, JNTU, Zen Technologies,


What is difference between %d and %i in c?

0 Answers  


Categories