some error in program

#include <iostream>
using namespace std;
void main()

{


float a;
cout<<" enter your number";
cin>>a;
if(a=(100 ^ 90));
cout<<"exlant";
if(a=(90 ^ 80));
cout<<"very good";
if(a=(80 ; 60));
cout<<"good";
if(a=(60 ^ 0));
cout<<"bad";
system ("pause");



}
many things. by 100 ^ 90 I assume you meant a range? surely you couldn't have meant 10090.. if you want a range, write if(a <= 100 && a > 90)
also, main() mustn't be void. it must be int, and return 0 upon success.
-------------------------------------------
#include <iostream>
using namespace std;
void main()


{

float a;
cout<<" enter your number";
cin>> a;
if(a <= 100 && a > 90);
cout<<"exlant";
if(a <= 89 && a > 80);
cout<<"very good";
if(a <= 79 && a > 59);
cout<<"good";
if(a <= 60 && a > 0);
cout<<"bad" ;
system ("pause");

}
-----------------------------

i have an error agin i can't get this
Try int main() and return 0;
#include <iostream>
using namespace std;
int main()
{

int a;
cout<<"enter your number:";
cin>> a;
if(a <= 100 && a > 90);
cout<<"\n excllant";
if(a <= 89 && a > 80);
cout<<"\n very good";
if(a <= 79 && a > 59);
cout<<"\n good";
if(a <= 60 && a > 0);
cout<<"\n bad" ;
return 0;

}

--------------------------

its print all i need to print one if i add number ,
Remove the ;'s behind the if statements.
thank you vrey much " kyon " you A Best Programer in C++
My program has working
Topic archived. No new replies allowed.