Answer Posted / sasi
Whenever Static is used with a Variable declaration .. it defines that the last updated value of the Variable will not be deleted after the process of a program .
Eg : #include <stdio.h>
int main() {
func();
func();
func();
}
void func() {
static int i=2;
i=i+1;
printf("%d
",i);
return 0;
}
Output :
3
4
5
Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What is a pointer on a pointer in c programming language?
What is the difference between exit() and _exit() function?
When we use void main and int main?
What are the 5 elements of structure?
What is a union?
PROGRAM TO WRITE CONTENTS OF 1 FILE IN REVERSE TO ANOTHER FILE,PROGRAM TO COPY 1 FILE TO ANOTHER BY SPECIFYING FILE NAMES AS COMMAND LINE
Can variables be declared anywhere in c?
Explain the use of #pragma exit?
Explain what could possibly be the problem if a valid function name such as tolower() is being reported by the c compiler as undefined?
Explain high-order bytes.
Who developed c language and when?
can any one tel me wt is the question pattern for NIC exam
Are comments included during the compilation stage and placed in the EXE file as well?
what is the height of tree if leaf node is at level 3. please explain
how to construct a simulator keeping the logical boolean gates in c