# 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
C Quiz on Octal Decimal and Hexadecimal Numbers | Guess the output of the programs given in the quiz?
If you finding difficulties to solve these questions then first you should learn these:-
Q1) Find the output of the given C program.
#include<stdio.h>
int main()
{
printf("%o",65);
return 0;
}
a) 101
b) 4
c) 65
d) ‘A’
View Answer
Answer:- a) 101Decimal to octal conversion
Q2) Find the output of the given C program.
#include<stdio.h>
int main()
{
printf("%x",65);
return 0;
}
a) ‘A’
b) 101
c) 41
d) 65
View Answer
Answer:- c) 41Decimal to Hexadecimal conversion
Q3) Find the output of the given C program.
#include<stdio.h>
int main()
{
printf("%x",95);
return 0;
}
a) 5f
b) 41
c) f5
d) 16
View Answer
Answer:- a) 5fDecimal to hexadecimal conversion. Note that if we use capital X in place of small x then we get 5F in place of 5f; printf(“%X”,95);
Q4) Find the output of the given C program.
#include<stdio.h>
int main()
{
printf("%d",0123);
return 0;
}
a) 0123
b) 123
c) None of these
d) 83
View Answer
Answer:- d) 83Octal to decimal conversion. In C language, when the number started with zero then it is an octal number.
Q5) Find the output of the given C program.
#include<stdio.h>
int main()
{
printf("%d",0x1A4);
return 0;
}
a) 400
b) 1A4
c) 420
d) None of these
View Answer
Answer:- c) 420Hexadecimal to decimal conversion. In C language, when the number is started with 0x or 0X then it is a hexadecimal number.
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!
Similar Quiz in C
- Quiz on Identifiers and Data Types in C
- C Quiz on Octal Decimal and Hexadecimal Numbers
- Increment and Decrement Operators Quiz
- Relational and Logical Operator Quiz
- Arithmetic and Assignment Operators Quiz
- Comma Operator Quiz
- Sizeof operator Quiz
- printf() Quiz Set-1
- printf() Quiz Set-2
- The printf() Quiz Set-3
- printf() Quiz Set-4
- C Quiz on If
- If-else statement Quiz in C
Learn programs