logo

CuriousTab

CuriousTab

Library Functions problems


  • 1. What will the function rewind() do?

  • Options
  • A. Reposition the file pointer to a character reverse.
  • B. Reposition the file pointer stream to end of file.
  • C. Reposition the file pointer to begining of that line.
  • D. Reposition the file pointer to begining of file.
  • Discuss
  • 2. Which standard library function will you use to find the last occurance of a character in a string in C?

  • Options
  • A. strnchar()
  • B. strchar()
  • C. strrchar()
  • D. strrchr()
  • Discuss
  • 3. Input/output function prototypes and macros are defined in which header file?

  • Options
  • A. conio.h
  • B. stdlib.h
  • C. stdio.h
  • D. dos.h
  • Discuss
  • 4. Can you use the fprintf() to display the output on the screen?

  • Options
  • A. Yes
  • B. No
  • Discuss
  • 5. What is stderr?

  • Options
  • A. standard error
  • B. standard error types
  • C. standard error streams
  • D. standard error definitions
  • Discuss
  • 6. What is the purpose of fflush() function.

  • Options
  • A. flushes all streams and specified streams.
  • B. flushes only specified stream.
  • C. flushes input/output buffer.
  • D. flushes file buffer.
  • Discuss
  • 7. What will the function randomize() do in Turbo C under DOS?

  • Options
  • A. returns a random number.
  • B. returns a random number generator in the specified range.
  • C. returns a random number generator with a random value based on time.
  • D. return a random number with a given seed value.
  • Discuss
  • 8. Does there any function exist to convert the int or float to a string?

  • Options
  • A. Yes
  • B. No
  • Discuss
  • 9. What will be the output of the program?
    #include<stdio.h>
    #include<string.h>
    
    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;
    }
    

  • Options
  • A. Missed
  • B. Got it
  • C. Error in memcmp statement
  • D. None of above
  • Discuss
  • 10. What will be the output of the program?
    #include<stdio.h>
    
    int main()
    {
        int i;
        i = scanf("%d %d", &i, &i);
        printf("%d\n", i);
        return 0;
    }
    

  • Options
  • A. 1
  • B. 2
  • C. Garbage value
  • D. Error: cannot assign scanf to variable
  • Discuss

First 2