| techboy (3) | |
|
As I came across difficulty on how to write nested if else statements. Please some can help me to give a tips for that. here is the programme i wrote. but it doesnt work. // question 1 #include <iostream> using namespace std ; int main() { int selection , rentaltype , time , week =0 , weekend ,rent , hours ; char custom = 0 ; cout << "enter hours , type , type simultaneously )" << endl ; cin >> hours >> time >> rentaltype ; if ( rentaltype == custom ) { if ( time == week ) { if ( hours <= 3 ) { rent = 25 ; cout << " rent amount is : " << rent << endl ; } } } else cout << " get out from my house " << endl ; return 0 ; } | |
|
|
|
| Texan40 (446) | |||
| |||
|
|
|||