-->

Write a program to get smallest number among three numbers.

//a program to get smallest number among three numbers.
#include<stdio.h>
#include<conio.h>
void main()
{
int x,y,z;
printf("enter 3 numbers\n");
scanf("%d%d%d",&x,&y,&z);
if(x<y && x<z)
{
printf("x is smallest");
}
elseif(y<x && y<z)
{
printf("y is smallest\n");
}
else
{
printf("z is smallest");
}
getch();
}

No comments:

Post a Comment