Thursday, 19 December 2019

Largest Number among three numbers in C

#include<stdio.h>
#include<conio.h>
int main()
{
int num1,num2,num3;
printf("Enter 1st no.: \n");
scanf("%d",&num1);
printf("Enter 2nd no.: \n");
scanf("%d",&num2);
printf("Enter 3rd no.: \n");
scanf("%d",&num3);
if(num1>num2 && num1>num3)
    {
         printf("the maximum number is %d\n",num1);
  }
   else if (num2>num3)
         printf("the maximum number is %d\n",num2);
   else
         printf("the maximum number is %d\n",num3);
getch();
return 0;
}

No comments:

Post a Comment

Convey your thoughts to authors.