proc() {
static i=10;
printf("%d",i);
}
If this proc() is called second time, what is the output?
Answer Posted / sujith
I dont know how can it be 11 next time.
I agree that static variables are assigned only once, and
allocation is happening to the data segment, but it doesnt
mean that is going to change the value on its own, until u
do that manually.
U call this program for n times, the answer is going to be 10.
| Is This Answer Correct ? | 7 Yes | 1 No |
Post New Answer View All Answers
Mention four important string handling functions in c languages .
c programs are converted into machine language with the help of a) an interpreter b) a compiler c) an operatinf system d) none of the above
What is an auto keyword in c?
How can I get the current date or time of day in a c program?
if p is a string contained in a string?
With the help of using classes, write a program to add two numbers.
Can we use any name in place of argv and argc as command line arguments?
What is strcpy() function?
What is declaration and definition in c?
What do you understand by normalization of pointers?
What is use of #include in c?
What are the key features in c programming language?
Given only putchar (no sprintf, itoa, etc.) write a routine putlong that prints out an unsigned long in decimal. [ I gave the obvious solution of taking % 10 and / 10, which gives us the decimal value in reverse order. This requires an array since we need to print it out in the correct order. The interviewer wasn't too pleased and asked me to give a solution which didn't need the array ].
what is the c source code for the below output? 5555555555 4444 4444 333 333 22 22 1 1 22 22 333 333 4444 4444 5555555555
Who developed c language and when?