extern static int i
func()
{
i =10;
i++;
printf("%d \n",i);
}
main()
{
i =20;
printf("%d \n",i);
func();
printf("%d \n",i);

}

Answers were Sorted based on User's Feedback



extern static int i func() { i =10; i++; printf("%d \n",i); } main() { i ..

Answer / vadivelt

Program should give compiler error. Cos, u r trying to
allocate two different storage area to sigle int
variable 'i'.

ie.,
The below statement is invalid.
extern static int i;

Is This Answer Correct ?    8 Yes 1 No

extern static int i func() { i =10; i++; printf("%d \n",i); } main() { i ..

Answer / ashwini prakash

output will be..
20
11
20

Is This Answer Correct ?    2 Yes 2 No

Post New Answer

More C Interview Questions

hi friends how r u as soon in satyam my interview is start but i m very confusued ta wat i do plz help me frndz wat can i do plz tell me some question and answers related with "C" which r asked in the interview .

0 Answers   Aegis, CDAC, Infosys,


write a programming in c to find the sum of all elements in an array through function.

0 Answers  


write a program to display the frequency of each element in a given array in c language

1 Answers  


What is difference between Structure and Unions?

0 Answers   TISL,


main() { int i = 1; int num[] = {1,2,3,4}; num[i] = i++; printf("%d", num[i]); } what will be the output? }

22 Answers   NDS, TCS,






what's the o/p int main(int n, char *argv[]) { char *s= *++argv; puts(s); exit(0); }

1 Answers   Motorola,


Can you please explain the difference between malloc() and calloc() function?

0 Answers  


This is a variation of the call_me function in the previous question:call_me (myvar)int *myvar;{ *myvar += 5; }The correct way to call this function from main() will be a) call_me(myvar) b) call_me(*myvar) c) call_me(&myvar) d) expanded memory

0 Answers  


Explain what is the difference between declaring a variable and defining a variable?

1 Answers  


Explain what is the use of a semicolon (;) at the end of every program statement?

0 Answers  


Are negative numbers true in c?

0 Answers  


What is mean by Data Driven framework in QTP? Can any one answer me in details on this regard.

0 Answers   IBM,


Categories