Monday, August 1, 2016

SWAPPING + GREATEST- C Program

/* SWAPPING + GREATEST*/

#include<conio.h>
#include<stdio.h>
void main()
{
float x,y,z,temp;
clrscr();
printf("Enter three numbers::");
scanf("%f%f%f",&x,&y,&z);
if (x>y)
{
if (x>z)
temp=x;
else
temp=z;
}
if (y>z)
temp=y;
printf("The greatest number is=%f",temp);
getch();
}

/* ***********************OUTPUT***************************
Enter three numbers:: 10 20 30
The greatest number is 30.000000*/

No comments:

Post a Comment