Decimal to octal and hexadecimal ( Chapter 1 Program 6

Also visit our YouTube Channel Tech Eos    VISIT CHANNEL



/*    6. Write a program to accept an integer and display it 
in octal and hexadecimal formats               */

#include<stdio.h>
#include<conio.h>

void main()
{
int number;

clrscr();

printf("\nEnter an number : ");
scanf("%d" , &number);

printf("\n\nDecimal format is     %d" , number);
printf("\nOctal format is       %o" , number);
printf("\nHexadecimal format is %x" , number);

getch();
}

Comments

Popular posts from this blog

Maximum from three numbers (Nested If ) (Chapter 2 Program 2 )

( Chapter 2 Program 7 )

Modular operator in c ( Chapter 1 Program 9)