c Programming Mc QS
c Programming Mc QS
#include <stdio.h>
int main()
{
int main = 3;
printf("%d", main);
return 0;
}
a) It will cause a compile-time error
b) It will cause a run-time error
c) It will run without any error and prints 3
d) It will experience infinite looping
6. The format identifier ‘%i’ is also used for _____ data type.
a) char
b) int
c) float
d) double
#include <stdio.h>
int main()
{
int var = 011;
printf("%d", var);
}
a) 2
b) 8
c) 9
d) 10
8. What will be the output for the given code printf(“\n The number is %07d”,1212);
a) The number is 0001212
b) The number is 1212
c) The number is 1212
d) The number is 1212000
a. compilation error
b. runtime error
c. neccse
d. neccse6
#include<stdio.h>
int main()
{
int a=5;
printf("%d"+1,a);
return 0;
a. compilation error
b. runtime error
c. 5
d. d
#include <stdio.h>
void main()
{
int x = 5.3 % 2;
printf("Value of x is %d", x);
}
a) Value of x is 2.3
b) Value of x is 1
c) Value of x is 0.3
d) Compile time error