Program to change decimal number into octal and hexadecimal number in c language.
#include<stdio.h>
#include<conio.h>
void main()
{
int n;
clrscr();
printf("enter the decimal number=");
scanf("%d",&n);
printf(" octal no. is =%o",n);
printf("\nhexadecimal no. is=%X",n);
getch();
}
■》OUTPUT->
enter the decimal number=15
octal no. is = 17
hexadecimal no. is= F
Comments
Post a Comment