#include<stdio.h> int main() { int y=128; const int x=y; printf("%d\n", x); return 0; }
Step 2: const int x=y; The constant variable 'x' is declared as an integer and it is initialized with the variable 'y' value.
Step 3: printf("%d\n", x); It prints the value of variable 'x'.
Hence the output of the program is "128"
#include<stdio.h> int main(int argc, char *argv, char *env[]) { int i; for(i=1; i<argc; i++) printf("%s\n", env[i]); return 0; }
#include<stdio.h> int fun(int, int); typedef int (*pf) (int, int); int proc(pf, int, int); int main() { printf("%d\n", proc(fun, 6, 6)); return 0; } int fun(int a, int b) { return (a==b); } int proc(pf p, int a, int b) { return ((*p)(a, b)); }
#include<stdio.h> int main() { int *j; void fun(int**); fun(&j); return 0; } void fun(int **k) { int a=10; /* Add a statement here */ }
/* sample.c */ #include<stdio.h> int main(int argc, char *argv[]) { int i=0; i+=strlen(argv[1]); while(i>0) { printf("%c", argv[1][--i]); } return 0; }
struct emp { int ecode; struct emp *e; };
Comments
There are no comments.Copyright ©CuriousTab. All rights reserved.