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

What is declaration and definition in c?

0 Answers  


Rapunzel walks into the forest of forgetfullness. She meets a Lion who lies on Monday Tuesdays and Wednesdays and meets a rabbit who lies on Thurs fridays and saturdays . On that day both say that "I lied yesterday". What day is it .

3 Answers   TCS,


How can I call a function with an argument list built up at run time?

0 Answers  


What are valid signatures for the Main function?

0 Answers  


Create a structure to specify data on students as given below: Roll number, Name, Department, Course, and Year of joining. Assume that there are not more than 450 students in the collage. (a) Write a function to print the names of all students who joined in the last 3 years. (b) Write a function to print the data of a student whose roll numbers are divisible by 4.

0 Answers  






What does %c mean in c?

0 Answers  


How to print all the 26 alphabets in this order in C. AbCdEfGh..... it should print dynamically from a to z and do not print this using pgm like this print("Ab......"); Use loops or anything to print all alphabets

2 Answers   Hexaware,


Program to display given 3 integers in ascending order

1 Answers   N Tech,


List out few of the applications that make use of Multilinked Structures?

1 Answers   Accenture,


How to set file pointer to beginning c?

0 Answers  


What is the difference between void main and main in c?

0 Answers  


program for validity of triangle from 3 side

7 Answers  


Categories