Saturday, November 5, 2011

Decimal to roman using C language


#include<stdio.h>
#include<conio.h>
void main()
{
int n,k=1,i,j,r;
clrscr();
printf("Please enter the number:");
scanf("%d",&n);
while(n>0)
{
if(n>10)
{
printf("X");
n=n-10;
}
if(n==1)
{
printf("I");
n=n-1;
}
if(n==2)
{
printf("II");
n=n-2;
}
if(n==3)
{
printf("III");
n=n-3;
}
}
getch();

}

0 comments:

Post a Comment

You are most welcome for making comments here. I will consider your view and will reply you soon.