+ 1
Anyone know how to set ranges in variables
This is what I am trying to do. I guess by looking at the code you get the idea. #include <iostream> using namespace std; int main() { int mark = 64; if (mark < 65) { cout << "You failed." << endl; cout << "Sorry" << endl; } else { cout << "Congratulations!" << endl; cout << "You passed." << endl; cout << "You are awesome!" << endl; } if (60 - 65) { cout << "below a d"; } if (70 - 79) { cout << "you have a c"; } return 0; }
2 odpowiedzi
+ 1
use this
if(mark>=60 & & mark<=65)
and same idea for others
0
thanks!