Computer Science, asked by rachel6095, 11 months ago

Write a program to find maximum out of three numbers


LuckyYadav2578: in which language

Answers

Answered by anushka9514
0

hope It helped you

please follow me. ...

Attachments:
Answered by sougatap57
0

Answer:

The Language used:-

1. C++

2.C

1)c++ program

#include <iostream>

using namespace std;

int main()

{

 int a,b,c;

 cout<<"enter the three numbers";

 cin>>a>>b>>c;

 if((a>b)&&(a>c))

   {

    cout<<"greater"<<a;

   }

   else if((b>c)&&(b>a))

   {

   cout<<"greater"<<b;

   }

   else

   {

   cout<<"greater"<<c;

   }

  return 0;

}

output

enter the three numbers 5 9 7

greater 9

2)c program

#include <stdio.h>

int main()

{

   int a,b,c;

   printf("enter the two numbers");

   scanf("%d%d%d",&a,&b,&c);

   if((a>b)&&(a>c))

   {

       printf("greater=%d",a);

   }

   else if((b>c)&&(b>a))

   {

       printf("greater=%d",b);

   }

   else

   {

       printf("greater=%d",c);

   }

   return 0;

}

output

enter the three numbers 6 2 1

greater=6

Similar questions