Yes.
"main()" should be "int main()".
You don't declare "decision", "again" and don't include <iostream>, unless you just omitted that part..
You're abusing recursion. Recursively calling main() is a terrible practice, recursively calling decision is not needed either. This functionality should instead be implemented with loops.
Your main problem is that, unless again is an std::string, == doesn't do what you want. String literals are of type const char* (they are pointers) and when you compare two pointers , you compare the addresses they point to, not the objects. You should instead use strcmp().
#include<iostream>
#include<conio.h>
#include<stdio.h>
#include<string>
usingnamespace std;
void one();
void two();
void three();
void decision();
int num1, first1, second1, third1;
string first, second, third, again;
int main()
{
cout << "Input a 3 digit number: ";
cin >> num1;
first1 = num1 / 100;
second1 = num1 % 100 / 10;
third1 = num1 % 100 % 10;
if (first1 >= 10)
{cout << "Invalid number" << endl;
getch();
return 0;}
one();
two();
three();
cout << "The roman numerical equivalent of this number is: " << first << second << third << endl;
decision();
return 0;
}
void decision()
{
cout << "Again? Y/N\n";
cin >> again;
while (again == "y" || "Y" || "yes" || "Yes")
{system("cls");
main();}
if (again == "n" || "N" || "no" || "No")
{getch();}
else
{ cout << "Invalid answer";
decision();}
}
void one()
{
if (first1 == 9)
first = "CM";
if (first1 == 8)
first = "DCCC";
if (first1 == 7)
first = "DCC";
if (first1 == 6)
first = "DC";
if (first1 == 5)
first = "D";
if (first1 == 4)
first = "CD";
if (first1 == 3)
first = "CCC";
if (first1 == 2)
first = "CC";
if (first1 == 1)
first = "C";
if (first1 == 0)
first = "";
}
void two()
{
if (second1 == 9)
second = "XC";
if (second1 == 8)
second = "LXXX";
if (second1 == 7)
second = "LXX";
if (second1 == 6)
second = "LX";
if (second1 == 5)
second = "L";
if (second1 == 4)
second = "XL";
if (second1 == 3)
second = "XXX";
if (second1 == 2)
second = "XX";
if (second1 == 1)
second = "X";
if (second1 == 0)
second = "";
}
void three()
{
if (third1 == 9)
third = "IX";
if (third1 == 8)
third = "VIII";
if (third1 == 7)
third = "VII";
if (third1 == 6)
third = "VI";
if (third1 == 5)
third = "V";
if (third1 == 4)
third = "IV";
if (third1 == 3)
third = "III";
if (third1 == 2)
third = "II";
if (third1 == 1)
third = "I";
if (third1 == 0)
third = "";
}
If you removed the recursion, you wouldn't be having this problem.
This is because again == "y" || "Y" || "yes" || "Yes" doesn't do what you think. It should be again == "y" || again == "Y" || etc. The way you have it, it is always true.