0
guys can we use two if statement and one statement?
11 Answers
+ 2
why don't you try yourself....its not like your device is going to explode if you do some mistake......
+ 1
If(condition)
{
If(condition)
{
Statement
}
}
+ 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
0
Yes that's nested if
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...
0
do u know that you don't require to create a block if you have only a single statement inside if..
0
I think you are talking about an embedded if statement. If so, you can.
0
if(this){
if(this2){
}
else if(){
}
}
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
0
Yea u re ryt