Curioustab
Aptitude
General Knowledge
Verbal Reasoning
Computer Science
Interview
Aptitude
General Knowledge
Verbal Reasoning
Computer Science
Interview
Home
»
C Programming
»
Functions
What will be the output of the program? #include
int fun(int(*)()); int main() { fun(main); printf("Hi\n"); return 0; } int fun(int (*p)()) { printf("Hello "); return 0; }
Infinite loop
Hi
Hello Hi
Error
Correct Answer:
Hello Hi
← Previous Question
Next Question→
More Questions from
Functions
What will be the output of the program? #include
int fun(int i) { i++; return i; } int main() { int fun(int); int i=3; fun(i=fun(fun(i))); printf("%d\n", i); return 0; }
What will be the output of the program? #include
int func1(int); int main() { int k=35; k = func1(k=func1(k=func1(k))); printf("k=%d\n", k); return 0; } int func1(int k) { k++; return k; }
What will be the output of the program in 16 bit platform (Turbo C under DOS)? #include
int 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? #include
int 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 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
int fun(int); int main() { float k=3; fun(k=fun(fun(k))); printf("%f\n", k); return 0; } int fun(int i) { i++; return i; }
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 check (int, int); int main() { int c; c = check(10, 20); printf("c=%d\n", c); return 0; } 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? #include
int check(int); int main() { int i=45, c; c = check(i); printf("%d\n", c); return 0; } int check(int ch) { if(ch >= 45) return 100; else return 10; }
Discussion & Comments
No comments yet. Be the first to comment!
Name:
Comment:
Post Comment
Join Discussion
Discussion & Comments