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


Please Help Members By Posting Answers For Below Questions

Given an array of 1s and 0s arrange the 1s together and 0s together in a single scan of the array. Optimize the boundary conditions?

985


main() { struct s1 { char *str; struct s1 *ptr; }; static struct s1 arr[] = { {"Hyderabad",arr+1}, {"Bangalore",arr+2}, {"Delhi",arr} }; struct s1 *p[3]; int i; < BR> for(i=0;i<=2;i++) p[i] = arr[i].ptr; printf("%s ",(*p)->str); printf("%s ",(++*p)->str); printf("%s ",((*p)++)->str); }

925


What is 2c dna?

611


Explain what is the difference between null and nul?

664


what are the facialities provided by you after the selection of the student.

1664






What does it mean when the linker says that _end is undefined?

638


In c programming language, how many parameters can be passed to a function ?

637


What is the difference between malloc calloc and realloc in c?

655


Explain what are reserved words?

639


What is the use of extern in c?

651


What Is The Difference Between Null And Void Pointer?

650


illustrate the use of address operator and dereferencing operator with the help of a program guys plzzz help for this question

1590


Which header file is used for clrscr?

586


Are the expressions * ptr ++ and ++ * ptr same?

673


How old is c programming language?

584