how will i break this C++program?

can you help me solving this program?
As i enter a number, all the output is print on the screen..

#include<iostream.h>
int main()
{

int speed;

cout<< "Enter Speed";
cin>> speed;

if (speed >= 75)

cout<< "Your Too Fast";


if( speed<=74 || speed >55)

cout<< "Not Bad Your not too Fast";

if( speed<= 54 || speed >= 45)

cout<< "Medium";

if( speed<= 44)

cout<< "Your Too Slow";


return 0;


}
You should use && instead of || : if ( speed<=74 && speed >55 )
You can make your code shorter using something like this:
1
2
3
4
5
6
7
8
if (speed >= 75)
    cout<< "Your Too Fast";
else if( speed > 55 )
    cout<< "Not Bad Your not too Fast";
else if( speed >= 45)
    cout<< "Medium";
else
    cout<< "Your Too Slow";
Topic archived. No new replies allowed.