proc() {

static i=10;
printf("%d",i);
}

If this proc() is called second time, what is the output?

Answer Posted / vignesh1988i

if it is called for second time also ,it will be 10 only but
in a different thought....

static keyword is only one time initilization....if the
compailer when again reads the same line it blindly ignores
it and print the latest value of yhat static variable

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

a) Identify the following declarations. Ex. int i (integer variable) float a[l0](array of 10 real nos) int (*f())() void *f int (*f()) [] void *f int f[] [] [] char *(*f) () int (*f[]) [] float(*f) [] [] float **f int ******f

1589


Describe how arrays can be passed to a user defined function

788


How is a null pointer different from a dangling pointer?

561


Why can't I perform arithmetic on a void* pointer?

639


Which control loop is recommended if you have to execute set of statements for fixed number of times?

816






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.

609


How do I get a null pointer in my programs?

624


What is the use of pointers in C?

627


Explain what are reserved words?

639


Explain what will be the outcome of the following conditional statement if the value of variable s is 10?

752


What is the need of structure in c?

570


What are the advantages of using linked list for tree construction?

647


How can I implement sets or arrays of bits?

609


What is string in c language?

630


List the difference between a "copy constructor" and a "assignment operator"?

587