File Input Output - Study Mode
[#281] What will be the output of the following C code? #include <stdio.h>
struct p
{
struct p *next
int x
}
int main()
{
struct p *p1 = calloc(1, sizeof(struct p))
p1->x = 1
p1->next = calloc(1, sizeof(struct p))
printf("%d
", p1->next->x)
return 0
}
Correct Answer
(D) 0
[#282] Which of the following mathematical function requires 2 parameter for successful function call?
Correct Answer
(D) all of the mentioned
[#283] How many characters for pushback is guaranteed per file while using ungetc(c, fp)
?
Correct Answer
(A) Only 1 character
[#284] Which of the following function can be used to terminate the main() function from another function safely?
Correct Answer
(B) exit(expr)
[#285] What will be the output of the following C code (when 4 and 5 are entered)? #include <stdio.h>
void main()
{
int m, n
printf("enter a number")
scanf("%d", &n)
scanf("%d", &m)
printf("%d %d
", n, m)
}
Correct Answer
(D) 4 5