1. What will the function rewind() do? | ||||||||
- Answer&Explanation
Answer:Option D
Explanation : rewind() takes the file pointer to the beginning of the file. so that the next I/O operation will take place at the beginning of the file. |
2. Input/output function prototypes and macros are defined in which header file? | ||||||||
- Answer&Explanation
Answer:Option C
Explanation : stdio.h, which stands for "standard input/output header", is the header in the C standard library that contains macro definitions, constants, and declarations of functions and types used for various standard input and output operations. |
3. Which standard library function will you use to find the last occurance of a character in a string in C? | ||||||||
- Answer&Explanation
Answer:Option D
Explanation : strrchr() returns a pointer to the last occurrence of character in a string. Example: Output: The last position of '2' is 14.
|
4. What is stderr ? | ||||||||
- Answer&Explanation
Answer:Option C
Explanation : The standard error(stderr) stream is the default destination for error messages and other diagnostic warnings. Like stdout, it is usually also directed to the output device of the standard console (generally, the screen). |
5. Does there any function exist to convert the int or float to a string? | ||||
- Answer&Explanation
Answer:Option A
Explanation : 1. itoa() converts an integer to a string.
|
6. What is the purpose of fflush() function. | ||||||||
- Answer&Explanation
Answer:Option A
Explanation : "fflush()" flush any buffered output associated with filename, which is either a file opened for writing or a shell command for redirecting output to a pipe or coprocess. Example: |
7. Can you use the fprintf() to display the output on the screen? | ||||
- Answer&Explanation
Answer:Option A
Explanation : Do like this fprintf(stdout, "%s %d %f", str, i, a); |
8. What will the function randomize() do in Turbo C under DOS? | ||||||||
- Answer&Explanation
Answer:Option C
Explanation : The randomize() function initializes the random number generator with a random value based on time. You can try the sample program given below in Turbo-C, it may not work as expected in other compilers.
|