![]() |
|
|
||||
1.
What will the function randomize() do in Turbo C under DOS?
Answer & Solution
Answer: (C) returns a random number generator with a random value based on time.
Solution: 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. /* Prints a random number in the range 0 to 99 */ #include #include #include int main(void) { randomize(); printf("Random number in the 0-99 range: %d\n", random (100)); return 0; } ![]() 2.
Does there any function exist to convert the int or float to a string?
3.
What is the purpose of fflush() function.
Answer & Solution
Answer: (A) flushes all streams and specified streams.
Solution: "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: fflush(FilePointer); fflush(NULL); flushes all streams. ![]() 4.
What will the function rewind() do?
5.
Input/output function prototypes and macros are defined in which header file?
|