ExamVeda
Login
Home
1
What will be the output of the following C code?
#include <stdio.h>
int main()
{
    FILE *fp = stdin;
    int n;
    fprintf(fp, "%d", 45);
}
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
2
What will be the output of the following C code?
#include <stdio.h>
#include <string.h>
int main()
{
    char *str = "hello, world";
    char *str1 = "hello, world";
    if (strcmp(str, str1))
        printf("equal");
    else
        printf("unequal");
}
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
3
What is the function of FILE *tmpfile(void)?
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
4
What happens when zero flag is used with left justification?
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
5
What will be the output of the following C code?
#include <stdio.h>
int main()
{
    int n;
    scanf("%d", n);
    printf("%d\n", n);
    return 0;
}
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
6
Which of the following is not a valid mathematical function?
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
7
EOF is an integer type defined in stdio. hand has a value . . . . . . . .
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
8
What will be the output of the following C code?
#include <stdio.h>
#include <string.h>
int main()
{
    char *str = "hello, world";
    char str1[9];
    strncpy(str1, str, 9);
    printf("%s %d", str1, strlen(str1));
}
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
9
What will be the output of the following C code if following commands are used to run and if myfile does not exist?
gcc -o test test.c
./test > myfile

#include <stdio.h>
int main(int argc, char **argv)
{
    char c = 'd';
    putchar(c);
    printf(" %d\n", argc);
}
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
10
What will be the output of the following C code?
#include <stdio.h>
int main()
{
    char c = '�';
    putchar(c);
}
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board