Check The Programming Section
What is true about printf( )?
a) It is used to take input
b) It is a standard output function
c) It is used to print only character value
d) To print a value of a variable we need to pass the address of a varible
Identify the unformatted input function?
a) scanf()
b) gets()
c) fprintf()
d) fscanf()
What is the return type of the getchar()?
a) int
b) char
c) char *
d) float
What is the output of the code?
#include<stdio.h>
int main(){
int ch = 'A';
printf("%c",ch);
}
a) 65
b) A
c) Blank
d) Compile-Time Error
What is the output of the code? Consider that 65 is entered as input.
#include<stdio.h>
int main(){
int k = getchar();
printf("%d",k);
}
a) 65
b) 6
c) 54
d) Compile-Time Error
What is the output of the code?
#include<stdio.h>
int main(){
int i = 10, j = 2;
printf("%d ",printf("%d %d ",i,j));
}
a) 10 2 4
b) 10 2 2
c) 10 2 3
d) Compile-Time Error
What is the output of the code?
#include<stdio.h>
int main(){
int i = 10, j = 2;
printf("%d %d %d",i,j);
}
a) 10 2 0
b) 10 2 Run-time Error
c) 10 2 Blank
d) 10 2 Garbage Value
What is the output of the code? Consider that 65 and 78 is given as input.
#include<stdio.h>
int main(){
int i,j;
int k = scanf("%d %d",&i,&j);
printf("%d",k);
}
a) 65
b) 78
c) 2
d) 4
What is the output of the code?
#include<stdio.h>
int main(){
int i = 3,j = 7,k = 7;
printf("%d %d",3,i,j);
}
a) 3 3 7
b) 3 7
c) 3 3
d) 3 7 7
The syntax to print a % symbol using printf statement is_________
a) \%
b) %
c) '%'
d) %%
What is the output of the code?
#include<stdio.h>
int main(){
float f = 9;
printf("%f %d",f,(int)f);
}
a) 9 9
b) 9 9.000000
c) 9.000000 9
d) 9.000000 0