Skip to content

Commit fbb590d

Browse files
committed
added error to main, removed a curly brace
1 parent 2b2adad commit fbb590d

File tree

1 file changed

+29
-29
lines changed

1 file changed

+29
-29
lines changed

main.cpp

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,30 @@
1-
#include <iostream>
2-
#include <cmath>
3-
4-
using std::endl;
5-
using std::cin;
6-
using std::cout;
7-
8-
int main()
9-
{
10-
cout << "THE FIRST EXAMPLE MATH DISPLAY!\n";
11-
cout << "Hi, please enter two whole numbers: ";
12-
13-
int x,y;
14-
15-
cin >> x >> y;
16-
cout << "Addition: " << x + y << endl;
17-
cout << "Subtraction: " << x - y << endl;
18-
cout << "Multiplication: " << x * y << endl;
19-
if(y==0){
20-
cout << "Dividing by zero is not a number." << endl;
21-
cout << "Remainder: " << x << endl;
22-
}else{
23-
cout << "Division: " << x / y << endl;
24-
cout << "Remainder: " << x % y << endl;
25-
}
26-
cout << "Square Root: " << sqrt(x) << endl;
27-
cout << "Square: " << pow(x, y) << endl;
28-
29-
return 0;
1+
#include <iostream>
2+
#include <cmath>
3+
4+
using std::endl;
5+
using std::cin;
6+
using std::cout;
7+
8+
int main()
9+
10+
cout << "THE FIRST EXAMPLE MATH DISPLAY!\n";
11+
cout << "Hi, please enter two whole numbers: ";
12+
13+
int x,y;
14+
15+
cin >> x >> y;
16+
cout << "Addition: " << x + y << endl;
17+
cout << "Subtraction: " << x - y << endl;
18+
cout << "Multiplication: " << x * y << endl;
19+
if(y==0){
20+
cout << "Dividing by zero is not a number." << endl;
21+
cout << "Remainder: " << x << endl;
22+
}else{
23+
cout << "Division: " << x / y << endl;
24+
cout << "Remainder: " << x % y << endl;
25+
}
26+
cout << "Square Root: " << sqrt(x) << endl;
27+
cout << "Square: " << pow(x, y) << endl;
28+
29+
return 0;
3030
}

0 commit comments

Comments
 (0)