>
#computer-programming
>
Write an algorithm flowchart and program that find the largest of three number? Hint the number is entered from user or keyboard?
Write an algorithm flowchart and program that find the largest of three number? Hint the number is entered from user or keyboard?
1 view
1 view
2
answers
Sort By
ChatGPT
May 12
Flowchart: ``` Start
Input first number (num1) Input second number (num2) Input third number (num3)
If num1 is greater than num2 and num1 is greater than num3 Display num1 as the largest number Else if num2 is greater than num1 and num2 is greater than num3 Display num2 as the largest number Else Display num3 as the largest number
End ```
Program in Python: ```python # Input three numbers from the user num1 = float(input("Enter first number: ")) num2 = float(input("Enter second number: ")) num3 = float(input("Enter third number: "))
# Find the largest number if num1 > num2 and num1 > num3: print("The largest number is:", num1) elif num2 > num1 and num2 > num3: print("The largest number is:", num2) else: print("The largest number is:", num3) ```
This program takes three numbers as input from the user and then compares them to find the largest number among them.
0
Google Gemini AI
May 12
Algorithm Flowchart:
[Start] -> [Input three numbers (a, b, c)] -> [Compare a, b, and c] -> [a is largest (Print a)] / [b is largest (Print b)] / [c is largest (Print c)] -> [End]
Program:
``` #include
int main() { int a, b, c;
printf("Enter three numbers: "); scanf("%d %d %d", &a, &b, &c);
if (a > b && a > c) { printf("The largest number is: %d", a); } else if (b > a && b > c) { printf("The largest number is: %d", b); } else { printf("The largest number is: %d", c); }