+ 1

Where is the mistake... Because this doesn't work can you help me.

#include <iostream> using namespace std; int main() { int num,c; cin >> num; cin >> c; int a =(num/c)*100 ; if(a>100){cout <<"lower num. please";} if(a>90 && a<100){cout <<"5";} if(a>75 && a<90){cout <<"4";} if(a>65 && a<75){cout <<"3";} if(a<65 && a>0){cout <<"not passed ";} cout << a <<num <<c ; return 0; }

27th Feb 2017, 12:33 PM
Collder
6 Réponses
+ 4
if you are running this in the code playground you need to give all inputs at once seperated by new line: 40 62 "Submit"
27th Feb 2017, 12:40 PM
Burey
Burey - avatar
+ 3
missing } to close main function unless you just missed that when pasting here xD
27th Feb 2017, 12:35 PM
Burey
Burey - avatar
0
how do you know that
27th Feb 2017, 12:37 PM
Collder
0
i mean... that i miss } when i was pasting it
27th Feb 2017, 12:38 PM
Collder
0
Take out the please unless you want to cout the please
27th Feb 2017, 12:43 PM
Wyatt
Wyatt  - avatar
0
Your if statements miss the numbers 100, 90, 75, and 65. One line says a > 90 and the one below says a < 90. Where does 90 go? Nowhere. You should include 90 in one of the groups. Maybe a>= 90 or a <= 90 (NOT BOTH). Do the same for 100, 75, and 65.
27th Feb 2017, 1:50 PM
ic01010101 ◼️LM
ic01010101 ◼️LM - avatar