# C PROGRAMS
C Quiz
➤ Identifiers & Data Types Quiz
➤ Octal Decimal & Hexadecimal
➤ Increment-Decrement Quiz
➤ Relational-Logical Quiz
➤ Arithmetic -Assignment Quiz
➤ Comma Operator Quiz
➤ Sizeof operator Quiz
➤ printf() Quiz Set-1
➤ printf() Quiz Set-2
➤ printf() Quiz Set-3
➤ printf() Quiz Set-4
➤ If statement Quiz in C
➤ If-else statement Quiz
Printf() Quiz in C Set-1 | The printf() function in C programming language is used for output formatting. It is used to display information required by the user and also prints the value of the variables. It formats the output, like the width of the output, the sign of the output e.t.c
In C, there are many predefined library functions are available for input and output operations. These functions are collectively called standard input-output library functions, and all these functions are available in stdio.h
header file.
If you finding difficulties to solve these questions then first you should learn these:-
Printf() Quiz in C
Find the output of the programs given in the printf Quiz in C Set-1?
Q1) Find the output of the given C program.
#include<stdio.h>
int main()
{
printf("%d Hello %d");
return 0;
}
a) None of these
b) Garbage_value Hello Garbage_value
c) 1 Hello 1
d) 0 Hello 0
View Answer
Answer:- b) Garbage_value Hello Garbage_valueQ2) Find the output of the given C program.
#include<stdio.h>
int main()
{
printf("%f Hello %f");
return 0;
}
a) garbage_value Hello garbage_value
b) None of these
c) 1.000000 Hello 1.000000
d) 0.000000 Hello 0.000000
View Answer
Answer:- d) 0.000000 Hello 0.000000Q3) Find the output of the given C program.
#include<stdio.h>
int main()
{
printf("%s Friend %s");
return 0;
}
a) 1 Friend 1
b) 0 Friend 0
c) None of these
d) garbage_value Friend garbage_value
View Answer
Answer:- d) garbage_value Friend garbage_valueQ4) Find the output of the given C program.
#include<stdio.h>
int main()
{
printf("%c Friend %c");
return 0;
}
a) garbage_value Friend garbage_value
b) None of these
c) 0 Friend 0
d) 1 Friend 1
View Answer
Answer:- a) garbage_value Friend garbage_valueQ5) Find the output of the given C program.
#include<stdio.h>
int main()
{
printf("%d", 1.9);
return 0;
}
a) garbage value
b) 1.9
c) 1
d) None of these
View Answer
Answer:- a) garbage valuefloat to int conversion can’t perform directly.
Q6) Find the output of the given C program.
#include<stdio.h>
int main()
{
printf("%f",10);
return 0;
}
a) 0.000000
b) 10
c) error
d) 10.000000
View Answer
Answer:- a) 0.000000Q7) Find the output of the given C program.
#include<stdio.h>
int main()
{
printf("%f",(float)10);
return 0;
}
a) 10
b) error
c) 10.000000
d) 0.000000
View Answer
Answer:- c) 10.000000Q8) Find the output of the given C program.
#include<stdio.h>
int main()
{
printf("%f",float(10));
return 0;
}
a) 0.000000
b) 10.000000
c) 10
d) error
View Answer
Answer:- d) errorfloat(10) is not correct syntax of type casting, (float)10 or (float)(10) are correct.
If you enjoyed this post, share it with your friends. Do you want to share more information about the topic discussed above or do you find anything incorrect? Let us know in the comments. Thank you!