0 votes

What language are you after?

For the language C/C++, you can find similar examples here: https://question.onlinegdb.com/14977/how-to-write-program-greatest-number

Look at that example and try to do your own implementation.

If you get stuck, share your work so far (orange SHARE button in the code editor) and we'll be happy to help you get back on track.

Good luck!

For the language C/C++, you can find similar examples here: https://question.onlinegdb.com/14977/how-to-write-program-greatest-number

Look at that example and try to do your own implementation.

If you get stuck, share your work so far (orange SHARE button in the code editor) and we'll be happy to help you get back on track.

Good luck!

0 votes

please check if this is correct

def find_maximum(num1, num2, num3):

return max(num1, num2, num3)

def find_minimum(num1, num2, num3):

return min(num1, num2, num3)

num1 = float(input("Enter the first number: "))

num2 = float(input("Enter the second number: "))

num3 = float(input("Enter the third number: "))

maximum = find_maximum(num1, num2, num3)

minimum = find_minimum(num1, num2, num3)

print("Maximum number is:", maximum)

print("Minimum number is:", minimum)

def find_maximum(num1, num2, num3):

return max(num1, num2, num3)

def find_minimum(num1, num2, num3):

return min(num1, num2, num3)

num1 = float(input("Enter the first number: "))

num2 = float(input("Enter the second number: "))

num3 = float(input("Enter the third number: "))

maximum = find_maximum(num1, num2, num3)

minimum = find_minimum(num1, num2, num3)

print("Maximum number is:", maximum)

print("Minimum number is:", minimum)

0 votes

if(a>b&&a>c)

printf("a is greater);

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

printf("b is greater );

el;se

printf("c is greater);

printf("a is greater);

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

printf("b is greater );

el;se

printf("c is greater);

0 votes

take three variable input in array and then sort the array by using any sorting tech. Then the first element is the minimal element(a[0]) and the last element us the maximum element (a[1]) ;

This is how you get the max and min element in three numbers.

This is how you get the max and min element in three numbers.

0 votes

program FindMinBetween3Numbers;

uses math;

var num1, num2, num3, ans : int64;

w : string;

begin

ans := 0;

writeln('enter first number');

readln(num1);

writeln('enter second number');

readln(num2);

writeln('enter three number');

readln(num3);

writeln('write "min" if you wanna find minimum and write "max" if you wanna find maximum');

readln(w);

if w = 'min' then

begin

ans:= min(min(num1, num2), num3);

writeln('the minimum between', ' ', num1, ', ', num2, ' and ', num3, ' is ', ans );

end;

if w = 'max' then

begin

ans:= max(max(num1, num2), num3);

writeln('the maximum between', ' ', num1, ', ', num2, ' and ', num3, ' is ', ans );

end;

end.

uses math;

var num1, num2, num3, ans : int64;

w : string;

begin

ans := 0;

writeln('enter first number');

readln(num1);

writeln('enter second number');

readln(num2);

writeln('enter three number');

readln(num3);

writeln('write "min" if you wanna find minimum and write "max" if you wanna find maximum');

readln(w);

if w = 'min' then

begin

ans:= min(min(num1, num2), num3);

writeln('the minimum between', ' ', num1, ', ', num2, ' and ', num3, ' is ', ans );

end;

if w = 'max' then

begin

ans:= max(max(num1, num2), num3);

writeln('the maximum between', ' ', num1, ', ', num2, ' and ', num3, ' is ', ans );

end;

end.

0 votes

Well, it depends on which programming language you are looking to do this.

For example, in Python:

# Input three numbers from the user

num1 = float(input("Enter the first number: "))

num2 = float(input("Enter the second number: "))

num3 = float(input("Enter the third number: "))# Find the maximum and minimum using conditional statements

maximum = num1 # Assume num1 is the maximum initially

minimum = num1 # Assume num1 is the minimum initially# Compare with num2 and num3

if num2 > maximum:

maximum = num2

elif num2 < minimum:

minimum = num2if num3 > maximum:

maximum = num3

elif num3 < minimum:

minimum = num3# Display the results

print(f"The maximum number is: {maximum}")

print(f"The minimum number is: {minimum}")

Thanks

+1 vote

#include <stdio.h>

int main()

{

int a, b, c;

printf("Enter number a : ");

scanf("%d",&a);

printf("Enter number b : ");

scanf("%d",&b);

printf("Enter number c : ");

scanf("%d",&c);

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

printf("a is max");

}

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

printf("b is max");

}

else{

printf("c is max");

}

return 0;

}

int main()

{

int a, b, c;

printf("Enter number a : ");

scanf("%d",&a);

printf("Enter number b : ");

scanf("%d",&b);

printf("Enter number c : ");

scanf("%d",&c);

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

printf("a is max");

}

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

printf("b is max");

}

else{

printf("c is max");

}

return 0;

}

0 votes

#include<stdio.h>

int main() {

int i,arr[100],n,max,min;

printf("Enter the limit:");

scanf("%d",&n);

printf("Enter the values:");

for(i=0;i<n;i++)

{

scanf("%d",&arr[i]);

}

printf("Entered elements are:");

for(i=0;i<n;i++)

{

printf("\n%d\t",arr[i]);

}

max = arr[0];

min = arr[0];

for(i=0;i<n;i++)

{

if(arr[i] > max)

{

max=arr[i];

}

if(arr[i] < min)

{

min=arr[i];

}

}

printf("\nMaximum elements:%d",max);

printf("\nMinimum elements:%d",min);

}

...

using namespace std;

int main()

{

int a,b,c;

cin>>a;

cin>>b;

cin>>c;

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

{

cout<<a;

}

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

{

cout<<b;

}

else

{

cout<<c;

}

return 0;

}