Library Functions

11

What will function gcvt() do?

A. CONVERT vector to integer value
B. Convert floating-point number to a string
C. Convert 2D array in to 1D array.
D. Covert multi Dimensional array to 1D array

12

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;
}
A. Missed
B. Got it
C. Error in memcmp statement
D. None of above

13

What will be the output of the program?

#include<stdio.h>
#include<stdlib.h>

int main()
{
    char *i = "55.555";
    int result1 = 10;
    float result2 = 11.111;
    result1 = result1+atoi(i);
    result2 = result2+atof(i);
    printf("%d, %f", result1, result2);
    return 0;
}
A. 55, 55.555
B. 66, 66.666600
C. 65, 66.666000
D. 55, 55

14

What will be the output of the program?

#include<stdio.h>

int main()
{
    int i;
    char c;
    for(i=1; i<=5; i++)
    {
        scanf("%c", &c); /* given input is 'b' */
        ungetc(c, stdout);
        printf("%c", c);
        ungetc(c, stdin);
    }
    return 0;
}
A. bbbb
B. bbbbb
C. b
D. Error in ungetc statement.

15

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;
}
A. 1
B. 2
C. Garbage value
D. Error: cannot assign scanf to variable