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

Write a program to find factorial of a number using recursive function.

0 Answers   Global Logic, TCS,


What is the process to generate random numbers in c programming language?

0 Answers  


‘SAVEPOINT’ and ‘ROLLBACK’ is used in oracle database to secure the data comment. Give suitable examples of each with sql command.

0 Answers  


How to set file pointer to beginning c?

0 Answers  


main() { int x=5; printf("%d %d %d\n",x,x<<2,x>>2); }

11 Answers   CISOC, CitiGroup, College School Exams Tests,


What are the types of type qualifiers in c?

0 Answers  


what is ANSI and ISO

7 Answers   HCL,


Do pointers need to be initialized?

0 Answers  


what is the difference between definition and declaration? give me some examples.

2 Answers   TCS,


a number is perfect if it is equal to the sum of its proper divisor.. 6 is perfect number coz its proper divisors are 1,2 and three.. and 1+2+3=6... a number is deficient if the sum of its proper divisor is less than the number.. sample: 8 is deficient, coz its proper divisors are 1,2 and 4, and 1+2+4=7. abundant number, if the sum of its proper divisor is greater than the number.. sample..12 is abundant coz 1+2+3+4+6=16 which is geater than 12. now write a program that prompts the user for a number, then determines whether the number is perfect,deficient and abundant..

1 Answers  


what is the maximum no. of bytes calloc can allocate

4 Answers   Mphasis,


What is an lvalue?

0 Answers  


Categories