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() { float k=3; fun(k=fun(fun(k))); printf("%f\n", k); return 0; } int fun(int i) { i++; return i; }
5.000000
3.000000
Garbage value
4.000000
Correct Answer:
5.000000
← Previous Question
Next Question→
More Questions from
Functions
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; }
What will be the output of the program? #include
#include
int main() { int i=0; i++; if(i<=5) { printf("CuriousTab"); exit(1); main(); } return 0; }
In C all functions except main() can be called recursively.
Functions cannot return more than one value at a time
A function cannot be defined inside another function
If return type for a function is not specified, it defaults to int
A function may have any number of return statements each returning different values.
Functions can be called either by value or reference
Discussion & Comments
No comments yet. Be the first to comment!
Name:
Comment:
Post Comment
Join Discussion
Discussion & Comments