Thanks, Jim.
Now please help me with these queries.
Q1: This is the question from my post no. 1 above.
By the way, is there any way that I could check it for all the errors before I try to compile it? e.g. When I tried to compile the program the compiler (Dev-C++) highlighted only the bold line, so I don't know (I'm sure there are!) if there are errors in other lines too. If I had known this I would have also boldfaced those lines too. Do you get what I'm trying to ask?
Q2: Now I think there is still some logical errors or syntax related. Not sure. You see the error in the running program below.
Please help me with these issues. It would be really kind of you. Thanks.
This is the copy of running program from the command prompt:
Code:
Enter the three numbers
Enter a = 901
Enter b = 4
Enter c = 0
a is the largest
c is the largest
Amended code is:
Code:
#include <iostream>
#include <conio.h>
using namespace std;
int main()
{
float a, b, c;
cout << "Enter the three numbers" << endl;
cout << "Enter a = ";
cin >> a;
cout << "Enter b = ";
cin >> b;
cout << "Enter c = ";
cin >> c;
if ((a > b)&&(c < b))
cout << "a is the largest" << endl;
if ((b > a)&&( c < a))
cout << "b is the largest" << endl;
else
cout << "c is the largest" << endl;
getch();
}