haveing a problem with my Code
So I have this code and when I try to compile it I get Declaration terminated incorrectly.. its states that this is located on line 16. I'm using Borland C++ 5.5.1 for Win32 to compile.
here is my code
Code:
#include <iostream>
#include <stdio.h>
#include <iostream.h>
using namespace std;
int main()
{
cout<<"hello World!! Please press enter to continue! ";
getchar();
cout<<"This is one of Will's simple C++ programs...He is a noob programer =D";
return 0;
}
{
cout << "would you like to see me do some mathimatical calculations? Then press enter!";
getchar();
return 0;
}
{
float num1;
float num2;
int num3;
float num4;
cout << "please Enter a number! any number!!!"; <<endl;
cin >> num1;
cout << "please Enter Another number!"; <<endl;
cin >> num2
cout << "Now Choose an operation!!1 to add, 2 to subtract, 3 to multiply, 4 to divide." <<endl;
cin >> num3;
if (num3 >4 || num3 <1)
{
cout << "Your operation choice isn't valid! Please run the program again." << endl;
cout << "Press Enter to end program." << endl;
getchar();
return 0;
}
else
{
if (num3 == 1)
{
num4 = num1 + num2;
cout << "Result is: "<< num4 << endl;
}
else if (num3 == 2)
{
num4 = num1 - num2;
cout << "Result is: "<< num4 << endl;
}
else if (num3 == 3)
{
num4 = num1 * num2;
cout << "Result is: "<< num4 << endl;
}
else if (num3 == 4)
{
num4 = num1 / num2;
cout << "Result is: " << num4 << endl;
}
}
cout << "Press Enter to end program." << endl;
getchar();
return 0;
}