Q)Write a C++ program that receives the total number of integers (N). Then, the program will
ask for N real numbers. By applying for loop, your program should find and display the
largest and the lowest of the numbers. Give a proper message for invalid user input.If the input is below 0 print real numbers only and prompt again ,if enter 0 print wrong input all repetition until the user enters number greater than 1.
problem 1) Min and max values are same
problem 2) I also have to add some conditions on which
"NOT A HOMEWORK PROBLEM :D WE DONT GET SUCH COMPLICATED EXERCISES HERE JUST SOME PRACTICE PROBLEMS FOUND FROM IT DEPARTMENT"
You reset the min and max every time on lines 22 and 23. Currently, lines 25-32 are pointless, because lines 22 and 23 already do what they do.
Think about this differently. Do you really want to set the min and max every time through the loop? What if you could set them to some initial value outside the loop, then perform checks inside the loop for every number?