# C Quiz on Octal Decimal and Hexadecimal Numbers

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’

Decimal 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

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

Decimal 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

Octal 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