Friday, August 16, 2019

WAP to find the largest of three number's.

// C program

#include<stdio.h>
void main()
{
    int a,b,c;
    clrscr();
    printf("Enter any three numbers:");
    scanf("%d %d %d",&a,&b,&c);
    if((a>b)&&(a>c))
        printf("%d",a," is a largest number");
   elseif((b>a)&&(b>c))
        printf("%d",b," is a largest number");
   else
        printf("%d",c," is a largest number");
  getch();
}

Sample Input/Output:

Enter any three numbers:10
20
30
30 is a largest number

No comments:

Post a Comment

Write a program to find gcd of two numbers using recursion.

About:  The process in which a function calls itself is called recursion and the corresponding function is called as recursive function. ...