Professional Documents
Culture Documents
LABORATORY ASSIGNMENT
DUE: NOVEMBER 12, 2021 (6:00PM)
PROBLEM: Create a C program that will input 3 numbers and output the LARGEST among 3
numbers.
FLOWCHART:
Start
a, b, c
Yes Yes
a>b a>c
a
No No
No c
b>c
Yes
b End
CODE:
#include <stdio.h>
int main(){
int num1, num2, num3;
if (num1>num2){
if (num1>num3)
printf("\nNUM1 is the largest among 3 numbers.");
else
printf("\nNUM3 is the largest among 3 numbers.");
}
else{
if (num2>num3)
printf("\nNUM2 is the largest among 3 numbers.");
else
printf("\nNUM3 is the largest among 3 numbers.");
}
return 0;
}
OUTPUT: