Decimal number to hexadecimal and octal number

Program:

#include<stdio.h>
int main()
{
int x;
printf("Enter decimal number: ");
scanf("%d",&x);
printf("Decimal Number: %d\n",x);
printf("Hexadecimal Number: %x\n",x);
printf("Octal Number: %o\n",x);
}

Output:


No comments:

Post a Comment

x^y using recursion

Program: #include<stdio.h> int power(int a,int b); int main() { int x,y,ans; printf("Enter x and y:\n "); scanf(...