guys can we use two if statement and one statement? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

guys can we use two if statement and one statement?

15th Jul 2016, 5:10 PM
Khair Baksh
Khair Baksh - avatar
11 Answers
9th Jun 2021, 8:42 AM
Tharul Nejana
Tharul Nejana - avatar
+ 2
why don't you try yourself....its not like your device is going to explode if you do some mistake......
15th Jul 2016, 6:13 PM
Mukul Kumar
Mukul Kumar - avatar
+ 1
If(condition) { If(condition) { Statement } }
15th Jul 2016, 5:23 PM
Aqib Ansari
Aqib Ansari - avatar
+ 1
I don't understand what u said, but see this.. two if statement program.. #include<iostream> using namespace std; int main() { int a=5, b=7, big; big=a; if(a>b) big =a; if(a<b) big=b; cout<<"biggest no is: <<big<<'\n'; return 0; } compile and run it
20th Jul 2016, 1:32 PM
meherDev
meherDev - avatar
0
Yes that's nested if
15th Jul 2016, 5:22 PM
Aqib Ansari
Aqib Ansari - avatar
0
yes we can use two if statements and one simple statement, that is nested if statement...In which you create an if statement and apply another if statement inside it...
15th Jul 2016, 5:22 PM
Prabhjot
0
do u know that you don't require to create a block if you have only a single statement inside if..
15th Jul 2016, 5:26 PM
Prabhjot
0
I think you are talking about an embedded if statement. If so, you can.
15th Jul 2016, 6:50 PM
Adam
0
if(this){ if(this2){ } else if(){ } }
17th Jul 2016, 6:35 AM
Dogcatfee
Dogcatfee - avatar
0
I don't understand what u said, but see this.. two if statement program.. #include<iostream> using namespace std; int main() { int a=5, b=7, big; big=a; if(a>b) big =a; if(a<b) big=b; cout<<"biggest no is: "<<big<<endl; return 0; } compile and run it
20th Jul 2016, 1:32 PM
meherDev
meherDev - avatar
0
Yea u re ryt
22nd Aug 2016, 7:36 AM
Richard Favour
Richard Favour - avatar