Write a program that accepts an ordinary number and output. Its equivalent roman numerals. The ordinary numbers and their equivalent roman numerals are given below
1 I
5 V
10 X
50 L
100 C
500 D
1000 M
*use pointer to give value to the number
Sample: 2968
MMCM LXVIII
and this is what ive done so far
#include<stdio.h>
#include<conio.h>
main()
{
int n,n1,i,k;
int a[]={1000,500,100,50,10,5,1};
char b[]={'M','D','C','L','X','V','I'};
char * mypointer;
clrscr();
printf("Input a number ");
scanf("%d",&n);
printf("\nROMAN equivalent of %d is ",n);
for (k=0;k<7;k++)
{
n1=n/a[k];
for(i=0;i<n1;i++)
printf("%c",*mypointer[k]);
n=n%a[k];
}
}
now im getting error which says mypointer is declared but never used in fuction main and b is declared but never used in function main,.. i guess because on my pointers value,..
can anyone help put?its been my probem for 2 days lol

New Topic/Question
Reply




MultiQuote






|