Question

3.14 CH3 LAB: Largest number Write a program whose inputs are three integers, and whose output...

3.14 CH3 LAB: Largest number

Write a program whose inputs are three integers, and whose output is the largest of the three values. If the input is 7 15 3, the output is: 15

LAB

ACTIVITY

please give me code in c++

3.14.1: CH3 LAB: Largest number

0 0
Add a comment Improve this question Transcribed image text
Answer #1

CODE :

#include <iostream>
using namespace std;
int main()
{
int a,b,c;
cout <<"Enter Integers "; //taking input from user and storing them in a,b,c
cin >>a>>b>>c;
if(a>=b and a>=c) // checking if A is largest among 3 Numbers
{
cout <<"Largest Number is "<<a;
}
else if(b>=a and b>=c) // checking if B is largest among 3 Numbers
{
cout <<"Largest Number is "<<b;
}
else // if A and B not Largest then C must be largest among 3
{
cout <<"Largest Number is "<<c;
}
return 0;
}

Add a comment
Know the answer?
Add Answer to:
3.14 CH3 LAB: Largest number Write a program whose inputs are three integers, and whose output...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Coral 5.1. Write a program whose inputs are three integers, and whose output is the largest...

    Coral 5.1. Write a program whose inputs are three integers, and whose output is the largest of the three values. Ex: If the input is 7 15 3, the output is: 15 Please provide the answer in Coral with proper line spacing/format.

  • 4.12 LAB: Smallest number Write a program whose inputs are three integers, and whose output is...

    4.12 LAB: Smallest number Write a program whose inputs are three integers, and whose output is the smallest of the three values. Ex: If the input is: 7 15 3 the output is: 3 I have to write this in python, having a hard time deciding how to approach this. Thank you!

  • Write a program whose inputs are three integers, and whose output is the smallest of the three values.

    # Python Write a program whose inputs are three integers, and whose output is the smallest of the three values. a.) Write out the steps of a computational thinking process b.) Write out the Pseudocode c.) Write out the Python code

  • Write a program whose input is two integers and whose output is the two integers swapped....

    Write a program whose input is two integers and whose output is the two integers swapped. Write in C language 7.3 LAB: Swapping variables Write a program whose input is two integers and whose output is the two integers swapped. Ex: If the input is: 38 then the output is: 83 Your program must define and call a function. SwapValues returns the two values in swapped order. void SwapValues(int* userVali, int* userVal2) ACRIVITY 7.3.1: LAB: Swapping variables 0/10 ] main.c...

  • 3.16 LAB: Output range with increment of 10 Write a program whose input is two integers,...

    3.16 LAB: Output range with increment of 10 Write a program whose input is two integers, and whose output is the first integer and subsequent increments of 10 as long as the value is less than or equal to the second integer. Ex: If the input is: -15 30 the output is: -15 -5 5 15 25 Ex: If the second integer is less than the first as in: 20 5 the output is: Second integer can't be less than...

  • please can you help me with this problem in C programminig language C 6.33 LAB: Max...

    please can you help me with this problem in C programminig language C 6.33 LAB: Max And Min Number: x + m/zybook/NORMANDALECSC11111BenekeSpring2020/chapter/3/section/21 SCI 1111: Programming in C home > 3.21: LAB: Smallest number 3.21 LAB: Smallest number Write a program whose inputs are three integers, and whose output is the smallest of the three values. Ex: If the input is: 7 15 3 the output is:

  • Write MARIE assembly language programs that do the following: I. Write a program that inputs thre...

    Write MARIE assembly language programs that do the following: I. Write a program that inputs three integers, a, b, and c, in that order. It computes the following ia-bi-fc+ c The result should be written to output 2. Write a program that inputs integers, s. y, and z. It outputs the difference of the langest and first element entered. You may assume x. y, and z all have different values. So if 8, 12, and 9 are input, the output...

  • 16.17 LAB 7A: Largest number In this lab you will prompt the user to provide you...

    16.17 LAB 7A: Largest number In this lab you will prompt the user to provide you with 3 Integers. Then your program should display the largest of the 3 values. Example of a sample run Enter value 1:7 Enter value 2:15 Enter value 3:3 Largest value is: 15 Enter value 1:7 Enter value 2:7 Enter value 3:2 Largest value is: 7 Enter value 1:-10 Enter value 2 :-20 Enter value 3:-30 Largest value is: -10 ACTIVITY 16.17.1: LAB 7A: Largest...

  • Max and Min Number Codes

    How can I write a program whose inputs are three integers, and whose outputs are the largest of the three values and the smallest of the three values. As an example, if the input is 7 15 3, the output is:largest: 15 smallest: 3I want a program that will define and call two functions:Function LargestNumber(integer num1, integer num2, integer num3) returns integer largestNumFunction SmallestNumber(integer num1, integer num2, integer num3) returns integer smallestNum

  • Write a program that inputs ten (10) integers and then sorts them in order from largest...

    Write a program that inputs ten (10) integers and then sorts them in order from largest to smallest in the programming language called Perl. You do not need to error check the input; you can assume the user enters integers. You can select the sorting algorithm of your choice, but you must implement this algorithm yourself. You cannot use a built-in sorting function. [15 points] Below is an example of a sample program run: Unsorted: 10, 4, 23, 99, 7,...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT