logo

CuriousTab

CuriousTab

Discussion


Home C Programming Library Functions Comments

  • Question
  • 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.

  • Correct Answer
  • Reposition the file pointer to begining of file. 

    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.
    Example: rewind(FilePointer);

  • Library Functions problems


    Search Results


    • 1. What will be the output of the program?
      #include<stdio.h>
      
      int main()
      {
          const c = -11;
          const int d = 34;
          printf("%d, %d\n", c, d);
          return 0;
      }
      

    • Options
    • A. Error
    • B. -11, 34
    • C. 11, 34
    • D. None of these
    • Discuss
    • 2. What will be the output of the program?
      #include<stdio.h>
      
      int main()
      {
          const int x=5;
          const int *ptrx;
          ptrx = &x;
          *ptrx = 10;
          printf("%d\n", x);
          return 0;
      }
      

    • Options
    • A. 5
    • B. 10
    • C. Error
    • D. Garbage value
    • Discuss
    • 3. What will be the output of the program?
      #include<stdio.h>
      #include<stdlib.h>
      
      union employee
      {
          char name[15];
          int age;
          float salary;
      };
      const union employee e1;
      
      int main()
      {
          strcpy(e1.name, "K");
          printf("%s %d %f", e1.name, e1.age, e1.salary);
          return 0;
      }
      

    • Options
    • A. Error: RValue required
    • B. Error: cannot convert from 'const int *' to 'int *const'
    • C. Error: LValue required in strcpy
    • D. No error
    • Discuss
    • 4. What will be the output of the program?
      #include<stdio.h>
      
      int main()
      {
          const char *s = "";
          char str[] = "Hello";
          s = str;
          while(*s)
              printf("%c", *s++);
      
          return 0;
      }
      

    • Options
    • A. Error
    • B. H
    • C. Hello
    • D. Hel
    • Discuss
    • 5. What will be the output of the program in TurboC?
      #include<stdio.h>
      int fun(int **ptr);
      
      int main()
      {
          int i=10, j=20;
          const int *ptr = &i;
          printf(" i = %5X", ptr);
          printf(" ptr = %d", *ptr);
          ptr = &j;
          printf(" j = %5X", ptr);
          printf(" ptr = %d", *ptr);
          return 0;
      }
      

    • Options
    • A. i= FFE2 ptr=12 j=FFE4 ptr=24
    • B. i= FFE4 ptr=10 j=FFE2 ptr=20
    • C. i= FFE0 ptr=20 j=FFE1 ptr=30
    • D. Garbage value
    • Discuss
    • 6. 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
    • 7. 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
    • 8. Can you use the fprintf() to display the output on the screen?

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

    • Options
    • A. standard error
    • B. standard error types
    • C. standard error streams
    • D. standard error definitions
    • Discuss
    • 10. 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


    Comments

    There are no comments.

Enter a new Comment