I'm trying to create a program that takes 2 numbers from a user (a numerator and a denominator), displays one ontop of the other separated by dashes, and then shows the answer of one number divided by the other.
Inside an If statement, I want to output several lines using multiple cout statements, along with using an embedded if statement, but after the first cout statement, it seems to take me out of the If. What am I doing wrong?
#include <iostream>
using namespace std;
int main ()
{
int n1,n2
float n3
cout << "Enter the numerator: "
cin >> n1
cout << "Enter the denominator: "
cin >> n2
if ((n1 <10) && (n2 <10))
cout << "You want to see:" << endl;
cout << "" << endl;
cout << " " << n1 << endl;
cout << " -" << endl;
cout << " " << n2 << endl;
cout << " " << endl;
n3 = (n1 / n2) * 1.0000
if (n3 < 10)
cout << " " << n3;
else if ((n3 >= 10) && (n3 < 100))
cout << " " << n3;
else if ((n3 >= 100) && (n3 <1000))
cout << " " << n3
else if ((n1 >= 10) && (n1 <100) && (n2 <100))
cout << "You want to see:" << endl;
cout << "" << endl;
cout << " " << n1 << endl;
cout << " --" << endl;
cout << " " << n2 << endl;
cout << " " << endl;
n3 = (n1 / n2) * 1.0000
if (n3 < 10)
cout << " " << n3;
else if ((n3 >= 10) && (n3 < 100))
cout << " " << n3;
else if ((n3 >= 100) && (n3 <1000))
cout << " " << n3
else if ((n2 >= 10) && (n2 <100) && (n1 <100))
cout << "You want to see:" << endl;
cout << "" << endl;
cout << " " << n1 << endl;
cout << " --" << endl;
cout << " " << n2 << endl;
cout << " " << endl;
n3 = (n1 / n2) * 1.0000
if (n3 < 10)
cout << " " << n3;
else if ((n3 >= 10) && (n3 < 100))
cout << " " << n3;
else if ((n3 >= 100) && (n3 <1000))
cout << " " << n3
else if (n1 >= 100)
cout << "You want to see:" << endl;
cout << "" << endl;
cout << " " << n1 << endl;
cout << " ---" << endl;
cout << " " << n2 << endl;
cout << " " << endl;
n3 = (n1 / n2) * 1.0000
if (n3 < 10)
cout << " " << n3;
else if ((n3 >= 10) && (n3 < 100))
cout << " " << n3;
else if ((n3 >= 100) && (n3 <1000))
cout << " " << n3
else if (n2 >= 100)
cout << "You want to see:" << endl;
cout << "" << endl;
cout << " " << n1 << endl;
cout << " ---" << endl;
cout << " " << n2 << endl;
cout << " " << endl;
n3 = (n1 / n2) * 1.0000;
if (n3 < 10)
cout << " " << n3;
else if ((n3 >= 10) && (n3 < 100))
cout << " " << n3;
else if ((n3 >= 100) && (n3 <1000))
cout << " " << n3
}