0
Take an input of three numbers and display larger number by using nested if condition . this program is correct??
#include <iostream> using namespace std; int main() { int x=4; int y=5; int z=6; if(x<6){ if(y<6){ cout<<"The larger number is "<< z; } else{ cout<<"wrong"; } } return 0; }
3 Answers
+ 3
1. Your code does not rake input.
2. You hard-coded the values 6 in your conditions â it should be z, not 6
0
Find the larger number istead of display