Thank you for being a valued part of the CNET community. As of December 1, 2020, the forums are in read-only format. In early 2021, CNET Forums will no longer be available. We are grateful for the participation and advice you have provided to one another over the years.

Thanks,

CNET Support

Question

c++ whats wrong?

Apr 2, 2016 4:16PM PDT

Discussion is locked

- Collapse -
Answer
It's too small to read for starters.
Apr 2, 2016 4:22PM PDT

You may want to just paste the code in open text next time.

But there are new students that do what you did and get flamed. Not only must you share the code but explain what you think the problem is. As one person put it, we are not here to deflea your code.

You would tell what line failed and tell why you think it's bad.

- Collapse -
Update
Apr 2, 2016 4:28PM PDT

Screenshoot:
http://www.part.lt/img/c433c227488a17b8648719268f9fb4aa500.PNG

Code:
#include <iostream>

using namespace std;

int main()
{
int x;
int b = 12;
int d = 18;
int g = 30;
int a = 0
cin >>x;
if (x=<a){
cout << "gg";
}
if (a<x=<b){
cout << "3gg";
}
if (b<x=<d){
cout << "4gg";
}
if (d<x<=g){
cout << "5gg";
}
return 0;
}

Program told me:
Desktop\2258\main.cpp||In function 'int main()'Plain
Desktop\2258\main.cpp|12|error: expected ',' or ';' before 'cin'|
\Desktop\2258\main.cpp|13|error: expected primary-expression before '<' token|
Desktop\2258\main.cpp|16|error: expected primary-expression before '<' token|
\Desktop\2258\main.cpp|19|error: expected primary-expression before '<' token|
Desktop\2258\main.cpp|22|warning: comparisons like 'X<=Y<=Z' do not have their mathematical meaning [-Wparentheses]|

- Collapse -
The line with int a = 0?
Apr 2, 2016 4:40PM PDT

Looks like you forgot the statement terminator.