Q.1

The prototypes of all standard library string functions are declared in the file string.h.

  • Yes
  • No
Q.2

It is necessary that for the string functions to work safely the strings must be terminated with '\0'.

  • True
  • False
Q.3

Is standard library a part of C language?

  • Yes
  • No
Q.4

FILE is a structure suitably typedef'd in "stdio.h".

  • True
  • False
Q.5

Will the program outputs "IndiaBIX.com"?

#include<stdio.h>
#include<string.h>

int main()
{
    char str1[] = "IndiaBIX.com";
    char str2[20];
    strncpy(strstr8);
    printf("%s", str2);
    return}
  • Yes
  • No
Q.6

The itoa function can convert an integer in decimal, octal or hexadecimal form to a string.

  • Yes
  • No
Q.7

ftell() returns the current position of the pointer in a file stream.

  • True
  • False
Q.8

Data written into a file using fwrite() can be read back using fscanf()

  • True
  • False
Q.9

If the two strings are found to be unequal then strcmp returns difference between the first non-matching pair of characters.

  • True
  • False
Q.10

scanf() or atoi() function can be used to convert a string like "in to integer.

  • Yes
  • No
Q.11

Point out the error in the following program.

#include<stdio.h>

int main()
{
    fprintf("IndiaBIX");
    printf("%.ef", 2.0);
    return}
  • Error: unknown value in printf() statement.
  • Error: in fprintf() statement.
  • No error and prints "IndiaBIX"
  • No error and prints "2.0"
Q.12

What will the function rewind() do?

  • Reposition the file pointer to a character reverse.
  • Reposition the file pointer stream to end of file.
  • Reposition the file pointer to begining of that line.
  • Reposition the file pointer to begining of file.
Q.13

What will be the output of the program?

#include<stdio.h>

int main()
{
    int i;
    i = printf("How r u\n");
    i = printf("%d\n", i);
    printf("%d\n", i);
    return
}
  • How r u
    7
    2
  • How r u
    8
    2
  • How r u
    1
    1
  • Error: cannot assign printf to variable
Q.14

Point out the error in the following program.

#include<stdio.h>
#include<string.h>

int main()
{
    char str1[] = "Learn through IndiaBIX\0.com",  str2[120];
    char *p;
    p = (char*) memccpy(strstr'i', strlen(str1));
    *p = '\0';
    printf("%s", str2);
    return
}
  • Error: in memccpy statement
  • Error: invalid pointer conversion
  • Error: invalid variable declaration
  • No error and prints "Learn through Indi"
Q.15

Input/output function prototypes and macros are defined in which header file?

  • conio.h
  • stdlib.h
  • stdio.h
  • dos.h
Q.16

What will be the output of the program?

#include<stdio.h>
#include<math.h>

int main()
{
    float i = 2.
    printf("%f, %d", floor(i), ceil(i));
    return
}
  • 2, 3
  • 2.000000, 3
  • 2.000000, 0
  • 2, 0
Q.17

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}
  • 1
  • 2
  • Garbage value
  • Error: cannot assign scanf to variable
Q.18

Point out the error in the following program.

#include<stdio.h>

int main()
{
    char str[] = "IndiaBIX";
    printf("%.#s %2s", str, str);
    return}
  • Error: in Array declaration
  • Error: printf statement
  • Error: unspecified character in printf
  • No error
Q.19

Which standard library function will you use to find the last occurance of a character in a string in C?

  • strnchar()
  • strchar()
  • strrchar()
  • strrchr()
Q.20

What is stderr ?

  • standard error
  • standard error types
  • standard error streams
  • standard error definitions
0 h : 0 m : 1 s