Nested if else | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Nested if else

what is wrong the code? #include <iostream> using namespace std; int main() { int = dar; cin >> dar; if (dar >= 10) { if (dar == 15) { cout << "the number is magic" << endl; } cout << "the number is grater than 10" << endl; } else { cout << "the number is smaller than 10" << endl; } return 0; } thank you

13th Oct 2017, 1:14 PM
Dariush Shiri
Dariush Shiri - avatar
3 Answers
+ 9
Follow the error messages. The problem exists in the line int = dar;
13th Oct 2017, 1:20 PM
jay
jay - avatar
+ 9
There is an additional "equal to" sign in below statement: Int = dar; Works for me otherwise: https://code.sololearn.com/cnNc00Wy6Or1/?ref=app
13th Oct 2017, 1:22 PM
Apoorva Shenoy Nayak
Apoorva Shenoy Nayak - avatar
+ 2
got it thank you :)
13th Oct 2017, 1:26 PM
Dariush Shiri
Dariush Shiri - avatar