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 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); }
AB
BC
CD
No output
Correct Answer:
BC
← Previous Question
Next Question→
More Questions from
Functions
What will be the output of the program? #include
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)); }
What will be the output of the program? #include
int 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? #include
int main() { int i=1; if(!i) printf("CuriousTab,"); else { i=0; printf("C-Program"); main(); } return 0; }
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; }
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--); }
Discussion & Comments
No comments yet. Be the first to comment!
Name:
Comment:
Post Comment
Join Discussion
Discussion & Comments