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

Chapter 2 Program 9

Maximum from three ( Chapter 2 Program 6 )

average temperature of five sunny days (Chapter 1 Program 10 )