Wednesday, 26 December 2012

Decimal to any number system conversion:


The program for Decimal to any base conversion:

This program converts a decimal number to any base that user wants.. The User at first , enters the the number and the output base and the program converts the decimal number to the wanted base.

//Decimal to any base....

#include<stdio.h>
#include<conio.h>
void main()
{
int outputnumber,outputbase,k,s;
long signed int op=0,p;
clrscr();
printf("Enter the Decimal number and the outputbase ");
scanf("%d%d",&outputnumber,&outputbase);
k=outputnumber;
p=1;
while(k!=0)
{
s=k%outputbase;
k=k/outputbase;
op=op+s*p;
p=p*10;
}
printf("The converted number is %ld",op);
getch();
}

and the output is like::



1 Responses to “Decimal to any number system conversion:”

walestacke said...
3 March 2022 at 17:27

Las Vegas - Casino & Resort Spa Reviews, Photos & Rates
Our honest Casino and 삼척 출장샵 Resort Spa reviews & ratings. ✓Excellent 영주 출장안마 hotel, ✓Excellent 통영 출장마사지 customer 여수 출장샵 service, ⏰hours, ✓Free cancellation for a good 용인 출장안마 price. Rating: 3 · ‎Review by Josh Middleton


Post a Comment

Recent Comments

All Rights Reserved Assignments on C language