Question: Lab 4: DECISION MAKING Write C++ programs to do the following: [1-4 mandatory] 1. To check whether the given number is odd or even using
Lab 4: DECISION MAKING Write C++ programs to do the following: [1-4 mandatory] 1. To check whether the given number is odd or even using if- else statement. 2. To find the largest among given 3 numbers using if statement 3. To compute all the roots of a quadratic equation using switch statement. [Hint : x = (-b +/- sqrt(b2-4ac))/2a] 4. To check whether the given number is zero, positive or negative using else-if ladder. 5. To find the smallest among three numbers using conditional operator. 6. To accept the number of days a member is late to return the book and calculate and display the fine with the appropriate message using if-else ladder. The fine is charged as per the table below Late period Fine 5 days - 50 paise 6-10 days - 1 rupee Above 10 days - 5 rupees After 30 days - 10 rupees
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
