#include<stdio.h> int main() { extern int i; i = 20; printf("%d\n", sizeof(i)); return 0; }
int *ptr[30];
void (*cmp)();
char *ptr[3]();
char (*ptr)*[3];
char (*ptr[3])();
char (*ptr)[3];
char (*ptr)[3];
void *cmp();
char *scr;
#include<stdio.h> int main() { enum status { pass, fail, atkt}; enum status stud1, stud2, stud3; stud1 = pass; stud2 = atkt; stud3 = fail; printf("%d, %d, %d\n", stud1, stud2, stud3); return 0; }
stud1 = pass (value is 0)
stud2 = atkt (value is 2)
stud3 = fail (value is 1)
Hence it prints 0, 2, 1
#include<stdio.h> int main() { extern int a; printf("%d\n", a); return 0; } int a=20;
printf("%d\n", a); it prints the value of local variable int a = 20. Because, whenever there is a conflict between local variable and global variable, local variable gets the highest priority. So it prints 20.
#include<stdio.h> int X=40; int main() { int X=20; printf("%d\n", X); return 0; }
#include<stdio.h> int main() { extern int fun(float); int a; a = fun(3.14); printf("%d\n", a); return 0; } int fun(int aa) { return (int)++aa; }
#include<stdio.h> int main() { int i=5; for(;scanf("%s", &i); printf("%d\n", i)); return 0; }
Hence this for loop would get executed infinite times.
Comments
There are no comments.Copyright ©CuriousTab. All rights reserved.