Question 1
Predict the output of the below program:
#include <stdio.h>
int main()
{
printf("%c ", 5["GeeksQuiz"]);
return 0;
}
Compile-time error
Runtime error
Q
s
Question 2
Which of the following is the standard input stream in C?
stdout
Runtime error
stdin
stdfile
Question 3
Question 4
#include<stdio.h>
int main()
{
char *s = "Geeks Quiz";
int n = 7;
printf("%.*s", n, s);
return 0;
}
Question 5
#include <stdio.h>
int main(void)
{
int x = printf("GeeksQuiz");
printf("%d", x);
return 0;
}
Question 6
#include<stdio.h>
int main()
{
printf("%d", printf("%d", 1234));
return 0;
}
Question 8
Normally user programs are prevented from handling I/O directly by I/O instructions in them. For CPUs having explicit I/O instructions, such I/O protection is ensured by having the I/O instructions privileged. In a CPU with memory mapped I/O, there is no explicit I/O instruction. Which one of the following is true for a CPU with memory mapped I/O?
Question 9
Consider the following C - code :
#include <stdio.h>
int foo(int a)
{
printf("%d",a);
return 0;
}
int main()
{
foo;
return 0;
}
It’ll result in compile error because foo is used without parentheses.
No compile error and some garbage value would be passed to foo function. This would make foo to be executed with output “garbage integer”.
No compile error but foo function wouldn’t be executed. The program wouldn\'t print anything.
No compile error and ZERO (i.e. 0) would be passed to foo function. This would make foo to be executed with output 0.
Question 10
"Why is the & (address-of) operator used with scanf() when reading integer values?
To specify the format of the input.
To store the input at the variable’s memory address.
To perform pointer arithmetic.
It is optional and does not affect the function’s behavior.
There are 37 questions to complete.