I have just Started selflearning C++.
Q is to find first 2 highest nos from 5 nos.with while loop.But condn is it should check ,that not any numbers r repeated(ie.each no. must be unique).If not error message.
I have completed the code ,by showing first 2 highest nos.also i can display the error message if any no. is repeated,but once the error message is displayed ,it doesnt quit ,it takes remaining nos. and finds out the 2 highest nos.
//prog to demonstrate largest and secondlargest among 5 nos.with while loop//
else if (large==num)
if ((seclarge<num) &&(large>num))
cout<<"the largest is"<<large<<endl;
cout<<"the second large is"<<seclarge<<endl;
any help is appreciated.Thanks in advance.