Introduction
The following below describes how to write a program and draw a flow chart to find the largest of any three numbers.
Flow Chart:-
Flow chart to find the largest of any three numbers in C |
Program:-
#include <stdio.h>
#include <string.h>
void main(){
int x,y,z
chrscr();
printf("Enter any three numbers:");
scanf("%d%d%d",&x,&y,&z);
if(x>y){
if(x>z)
printf("%d is greatest",x)
else
printf("%d is greatest",z)
}
else if(y>z)
printf("%d is greatest",y)
else
printf("%d is greatest",z)
getch();
}
Summary
Thanks
Tags
c