Hello to all,
I want to write a program that accepts an ordinary number and output its equivalent roman numerals. I have written following code to do this but it is not working properly. I don't know what is problem in "number to roman conversion" program.
Code:
#include<stdio.h>
#include<conio.h>
main()
{
int ns,ns1,is,ks;
int as[]={1000,500,100,50,10,5,1};
char bs[]={'M','D','C','L','X','V','I'};
char * mypointers;
clrscr();
printf("Input a numbers ");
scanf("%d",&ns);
printf("\nROMAN equivalent are as follows of %d is ",ns);
for (ks=0;ks<7;ks++)
{
ns1=ns/as[ks];
for(is=0;is<n1;is++)
printf("%c",*mypointer[ks]);
ns=ns%a[ks];
}
}
Bookmarks