I started with this now I'm scratching my head wondering how to turn the 1's and 2' etc. into M,C,D,L,X,V, and I. I may have went at this the wrong way but I dont know. I figured I would error check the exceptions (ie IV, IX, XL, CM, etc.) later in for or do while loops. Any ideas on whether I ma going about this the right way, and maybee where to go with it so it makes sence, would greatly be appreciated.
Code:
#include <stdio.h>
#include<stdlib.h>
#include <time.h>
void main()
{
int year;
int Roman;
int M;
int D;
int C;
int L;
int X;
int V;
int I;
int change[6];
printf("Enter a year I'll convert it to its Roman Numeral Equivalent \n");
scanf("%d", &year);
M = year / 1000;
change[0] = year%1000;
D = change[0] / 500;
change[1]= change[0]%500;
C = change[1] / 100;
change[2] = change[1]%100;
L = change[2] / 50;
change[3] = change[2] % 50;
X = change[3] / 10;
change[4] = change[3] % 10;
V = change[4] / 5;
change[5] = change[4] % 5;
I = change[5] / 1;
}