What is the mean of nested here? | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
0

What is the mean of nested here?

15th Sep 2018, 4:03 AM
Parmal Chouriya
Parmal Chouriya - avatar
3 Respostas
+ 10
Nested if-else statements means one can use an if or an else if statement inside another if or else if statement.
15th Sep 2018, 4:49 AM
Nova
Nova - avatar
+ 9
/*These if statments are all nested inside the body of the first if statement as long as all the statments return true the last if statment will execute the println method šŸ˜‰*/ int i = 1; if(i ==1){ if(i%1==0){ if(i*2/2 ==1){ if(i!=2){ if(i>0){ if(i<2){ if(i>0&&i<2){ if(0*i+1==1){ if(i!=i/2){ System.out.print("yep thats a "+i);}}}}}}}} } else{System.out.println("Number is not 1");}
15th Sep 2018, 8:10 AM
D_Stark
D_Stark - avatar
+ 2
nested is use when in some code we find out the result for example:- finding the maximum number from 3 numbers ? so here is the c++ code:- int a=5,int b=7,int c=3; if(a>b&&a>c) cout<<"a is greater"; elseif(b>c&&b>a) cout<<"b is greater"; else(c>a&&c>b) cout<<"c is greater";
15th Sep 2018, 4:12 AM
Yesh Jadav
Yesh Jadav - avatar