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

write a program for egyptian fractions in c?

1 Answers   Satyam,


Can i use “int” data type to store the value 32768? Why?

0 Answers  


To what value are pointers initialized? 1) NULL 2) Newly allocated memory 3) No action is taken by the compiler to initialize pointers.

4 Answers   Aricent,


Is malloc memset faster than calloc?

0 Answers  


read an array and search an element

1 Answers  


Which function in C can be used to append a string to another string?

0 Answers  


Predict the output or error(s) for the following: 25. main() { printf("%p",main); }

3 Answers   Google, ME,


C program to read the integer and calculate sum and average using single dimensional array

0 Answers  


How does struct work in c?

0 Answers  


Why we write conio h in c?

0 Answers  


What is the time and space complexities of merge sort and when is it preferred over quick sort?

0 Answers   Amazon,


what does exit() do?

3 Answers   Cadence,


Categories