well,this is my college assignment question.the question ask us to write a program that can compare 3 number,who is the biggest and smaller.the output should be like this:
Enter 3 numbers.
Number1:
Number2:
Number3:
Main Menu
1)Find the biggest value among the 3 value you have enter juz now.
2)Find the smallest value among the 3 value you have enter juz now.
3)Exit program
Here are my coding for the upper part.
#include<iostream.h>
void main(){
int num1,num2,num3,x,max;
cout<<"Enter 3 numbers."<<endl;
cout<<"Number1:";
cin>>num1;
cout<<"Number2:";
cin>>num2;
cout<<"Number3:";
cin>>num3;
cout<<" Main Menu"<<endl
<<"1)Find and Display Biggest Number"<<endl
<<"2)Find and Display Smallest Number"<<endl
<<"3)Exit program"<<endl;
cin>>x;
if(x==1){
if(num1>num2 && num1>num3){
max=num1;
cout<<max;
}else if(num2>num1 && num2>num3){
max=num2;
cout<<max;
}else if(num3>num1 && num3>num2){
max=num3;
cout<<max;
what i want to ask is the lower part of this question.start from if statement there.is that correct?inside the if statement still can have if statement?