Curioustab
Aptitude
General Knowledge
Verbal Reasoning
Computer Science
Interview
Take Free Test
Aptitude
General Knowledge
Verbal Reasoning
Computer Science
Interview
Take Free Test
Library Functions Questions
C standard I/O library: what does rewind(stream) do to a file stream? Choose the most accurate behavior per ISO C for a valid open stream.
C strings: which standard library function finds the last occurrence of a character in a string? Pick the correct function name used to search from the end.
C headers: in which header are input/output function prototypes and macros defined? Choose the correct standard header for stdio APIs.
C stdio: can fprintf be used to display output on the screen? If yes, how would you direct output to the console?
C standard streams: what is stderr? Choose the most accurate description used in ISO C.
C stdio buffers: what is the purpose of fflush? Choose the best description of how fflush operates on streams.
Turbo C (DOS): what does randomize() do? Legacy compiler question about seeding the pseudo-random generator.
C conversion utilities: does a function exist to convert int or float to a string (text)? Answer with the standard-library perspective and common practice.
What will be the output of the program? #include
#include
int main() { char dest[] = {97, 97, 0}; char src[] = "aaa"; int i; if((i = memcmp(dest, src, 2))==0) printf("Got it"); else printf("Missed"); return 0; }
What will be the output of the program? #include
int main() { int i; i = scanf("%d %d", &i, &i); printf("%d ", i); return 0; }
What will be the output of the program? #include
#include
int main() { float i = 2.5; printf("%f, %d", floor(i), ceil(i)); return 0; }
What will function gcvt() do?
What will be the output of the program? #include
int main() { int i; i = printf("How r u "); i = printf("%d ", i); printf("%d ", i); return 0; }
What will be the output of the program? #include
int main() { int i; char c; for(i=1; i<=5; i++) { scanf("%c", &c); /* given input is 'b' */ ungetc(c, stdout); printf("%c", c); ungetc(c, stdin); } return 0; }
What will be the output of the program? #include
int main() { int i; char c; for(i=1; i<=5; i++) { scanf("%c", &c); /* given input is 'a' */ printf("%c", c); ungetc(c, stdin); } return 0; }
What will be the output of the program? #include
#include
int main() { char *i = "55.555"; int result1 = 10; float result2 = 11.111; result1 = result1+atoi(i); result2 = result2+atof(i); printf("%d, %f", result1, result2); return 0; }