Follow Our FB Page << CircleMedia.in >> for Daily Laughter. We Post Funny, Viral, Comedy Videos, Memes, Vines...


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

#include show(int t,va_list ptr1) { int a,x,i; a=va_arg(ptr1,int) printf(" %d",a) } display(char) { int x; listptr; va_star(otr,s); n=va_arg(ptr,int); show(x,ptr); } main() { display("hello",4,12,13,14,44); }

0 Answers   Wilco,


WAP to accept first name,middle name & last name of a student display its initials?

5 Answers   AITH, NIIT,


How to write c functions that modify head pointer of a linked list?

0 Answers  


What are the benefits of organizational structure?

0 Answers  


Are bit fields portable?

0 Answers   EXL,






write a program to sort the elements in a given array in c language

10 Answers   TCS,


What is .obj file in c?

0 Answers  


How can I prevent other programmers from violating encapsulation by seeing the private parts of my class?

1 Answers  


What does the format %10.2 mean when included in a printf statement?

0 Answers  


Write an interactive c program that will encode or decode a line of text. To encode a line of text, proceed as follows: Convert each character, including blank spaces, to its ASCII equivalent. Generate a positive random integer. Add this integer to the ASCII equivalent of each character. The same random integer will be used for the entire line of text. Suppose that N1 represents the lowest permissible value in the ASCII code, and N2 represents the highest permissible value. If the number obtained in step 2 above exceeds N2, then subtract the largest possible multiple of N2 from this number, and add the remainder to N1. Hence the encoded number will always fall between N1 and N2, and will therefore always represent some ASCII character. Display the characters that correspond to the encoded ASCII values. The procedure is reversed when decoding a line of text. Be certain, however, that the same random number is used in decoding as was used in encoding.

1 Answers   Amazon, CSJM, HCL, Microsoft, TCS, Wipro,


What is methods in c?

0 Answers  


Whether there can be main inside another main?If so how does it work?

14 Answers   Sail, Wipro,






Categories