C Programming :: Functions
-
What will be the output of the program in 16 bit platform (Turbo C under DOS)?
#includeint main() { int fun(); int i; i = fun(); printf("%d\n", i); return 0; } int fun() { _ AX = 1990; } -
What will be the output of the program?
#include void fun(int*, int*); int main() { int i=5, j=2; fun(&i, &j); printf("%d, %d", i, j); return 0; } void fun(int *i, int *j) { *i = *i**i; *j = *j**j; } -
What will be the output of the program?
#includeint i; int fun(); int main() { while(i) { fun(); main(); } printf("Hello\n"); return 0; } int fun() { printf("Hi"); } -
What will be the output of the program?
includeint reverse(int); int main() { int no=5; reverse(no); return 0; } int reverse(int no) { if(no == 0) return 0; else printf("%d,", no); reverse (no--); } -
What will be the output of the program?
#include void fun(int); typedef int (*pf) (int, int); int proc(pf, int, int); int main() { int a=3; fun(a); return 0; } void fun(int n) { if(n > 0) { fun(--n); printf("%d,", n); fun(--n); } } -
What will be the output of the program?
#include int sumdig(int); int main() { int a, b; a = sumdig(123); b = sumdig(123); printf("%d, %d\n", a, b); return 0; } int sumdig(int n) { int s, d; if(n!=0) { d = n%10; n = n/10; s = d+sumdig(n); } else return 0; return s; } -
What will be the output of the program?
#includeint main() { void fun(char*); char a[100]; a[0] = 'A'; a[1] = 'B'; a[2] = 'C'; a[3] = 'D'; fun(&a[0]); return 0; } void fun(char *a) { a++; printf("%c", *a); a++; printf("%c", *a); } -
What will be the output of the program?
#includeint main() { int fun(int); int i = fun(10); printf("%d\n", --i); return 0; } int fun(int i) { return (i++); } -
What will be the output of the program?
#include int check (int, int); int main() { int c; c = check(10, 20); printf("c=%d\n", c); return0; } int check(int i, int j) { int *p, *q; p=&i; q=&j; i>=45 ? return(*p): return(*q); } -
What will be the output of the program?
#includeint main() { int i=1; if(!i) printf("FRESHERGATE,"); else { i=0; printf("C-Program"); main(); } return 0; }

Whatsapp
Facebook