If the ages of Raj, Sumit and Amit are input by the user, write a program to determine the youngest of the three.
#include<iostream.h>#include<conio.h>void main(){int raj_age,sumit_age,amit_age;cout<<"Enter Raj age:";cin>>raj_age;cout<<"Enter Sumit age:";cin>>sumit_age;cout<<"Enter Amit age:";cin>>amit_age;if (raj_age<sumit_age && raj_age<amit_age)cout<<"Raj is youngest";else if(sumit_age<raj_age && sumit_age<amit_age)cout<<"Sumit is youngest";elsecout<<"Amit is youngest";getch();}
Comments
Post a Comment