Question:- Write a program to convert Decimal number to octal and hexadecimal.

 #include<stdio.h>

#include<conio.h>

void main()

{

 int n;

 clrscr();

 printf("ENTER THE DECIMAL NUMBER:");

 scanf("%d",&n);

 printf("CHANGE IN OCTAL: %o");

 printf("\nCHANGE IN HEXADECIMAL:%X");

 getch();

}

OUTPUT:-

ENTER THE DECIMAL NUMBER:15

CHANGE IN OCTAL:17

 CHANGE IN HEXADECIMAL: F


Comments

Popular posts from this blog