Colour Theme Font Size Options
 
 
 
Exercise 1

If-Else Statement Exercise: Find the Minimum

Write a program from scratch

  • Create a C++ program called ex1_smallest.cpp in Visul Studio project or create it in another IDE.
  • Read three integer numbers as input
  • Use well formed if-else statements to find the minimum of the numbers
  • Output the minimum value
  • Your results should be similar to this:
    Please enter three integer numbers : -10 15 600 The smallest number is: -10
  • Be sure to test with different numbers. What should happen if two or more numbers are tied for smallest?

When you are done:

  • Write comments that explain your if statements and boolean expressions. How they work?
  • For this exercise, you will have: ex1_smallest.cpp.
  • Complete all the exercises in this lab and upload the .cpp files and screenshots for the output in URCourses.