2 week in programming
I am learning to program in C++. I started off with 26 error, and now I am down to 1. I just dont understand what it is asking for in the errors. Can somebody help me out? I have tried to look on the internet but I still not understading the problem
//This program is going to take 2 numbers and tell which one is Smaller or equal and display it on the screen
#include <iostream>
using namespace std;
int main()
{
// Step 1: Input number
double number1;
cout << "Input number: ";
cin >> number1;
// Step 2: Input number2
double number2;
cout << "Input number2: ";
cin >> number2;
// Step 3: Compute Numbers
if (number1 < number2)
cout << number1 <<
else if ( number1 > number2)
cout << number2 <<
else (number1 = Number2)
cout << it is equal << endl;
return 0;
}
1>------ Build started: Project: LAB2A, Configuration: Debug Win32 ------
1>Compiling...
1>LAB2A.cpp
1>y:\d02828527\documents\visual studio 2008\projects\lab2a\lab2a\lab2a.cpp(26) : error C2059: syntax error : 'else'
1>Build log was saved at "file://\\ilabss\home$\D02828527\Documents\Visual Studio 2008\Projects\LAB2A\LAB2A\Debug\BuildLog.htm"
1>LAB2A - 1 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========