ExamVeda
Login
Home
21
Identify X library function for line input and output in the following C code?
#include <stdio.h>
int X(char *s, FILE *iop)
{
    int c;
    while (c = *s++)
    putc(c, iop);
    return ferror(iop) ? EOF : 0;
}
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
22
What specifies the minimum number of characters to print after being padded with zeros or blank spaces?
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
23
What will be the output of the following C code?
#include <stdio.h>
int main()
{
    char n[20];
    fgets(n, 19, stdin);
    ungetc(n[0], stdin);
    scanf("%s", n);
    printf("%s\n", n);
    return 0;
}
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
24
What symbol is used to Left-justify within the data given field width?
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
25
What will be the output of the following C code?
#include <stdio.h>
#include <stdarg.h>
void func(int, ...);
int main()
{
    func(2, 3, 5, 7, 11, 13);
    return 0;
}
void func(int n, ...)
{
    int number, i = 0;
    va_list start;
    va_start(start, n);
    while (i != 3)
    {
        number = va_arg(start, int);
        i++;
    }
    printf("%d", number);
}
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
26
What will be the output of the following C code?
#include <stdio.h>
int main()
{
    char n[] = "hello\nworld!";
    char s[13];
    sscanf(n, "%s", s);
    printf("%s\n", s);
    return 0;
}
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
27
What will be the output of the following C code?
#include <stdio.h>
#include <ctype.h>
int main()
{
    int i = 32;
    if (isspace(i))
        printf("space\n");
    else
        printf("not space\n");
        return 0;
}
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
28
What will be the output of the following C code?
#include <stdio.h>
#include <stdarg.h>
int f(int c, ...);
int main()
{
    int c = 97;
    float d = 98;
    f(c, d);
    return 0;
}
int f(int c, ...)
{
    va_list li;
    va_start(li, c);
    float d = va_arg(li, float);
    printf("%f\n", d);
    va_end(li);
}
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
29
The functions vprintf(), vfprintf(), and vsprintf() are not equivalent to the corresponding printf() functions except the variable argument list.
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
30
Which is true about isalnum(c), where c is an int that can be represented as an unsigned?
char or EOF.isalnum(c) returns
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board