Skip to content
DATA STRUCTURE
DATA STRUCTURE

Learn everything about Data structure

  • Algorithms
  • DSA
  • Array
  • Stack
  • Queue
  • Matrix
  • Programs
DATA STRUCTURE

Learn everything about Data structure

Algorithm to find Maximum of three numbers

YASH PAL, September 24, 2022March 6, 2023

In this tutorial, we are going to write an algorithm to find the Maximum of three numbers. using this algorithm we can write a program to find a Maximum of three numbers in most programming languages like Java, Python, C++, and C programming.

[br]

Algorithm to find the Maximum of three numbers.

1. Read A, B, C.
2. If A > B, then:
3.   If A > C, then:
4.       Set MAX:=A
5.   Else:
6.      Set MAX:=C.
7.   [End of If structure]
8.  Else:
9.     If B > C, then:
10.       Set MAX:=B.
11.    Else:
12.       Set MAX:=C.
13.   [End of If Structure.]
14. Write MAX.
15. Exit
[br]
Here in the above Algorithm, we first read three numbers A, B, and C. then we check if the value of A is greater than B and again we check if the value of A is greater than C then we set the value of A to the MAX variable. else we will set the value of C to the MAX variable. here first if the condition will end and in the second else condition we will check if the value of B is greater than C then we will set the value of B to the MAX variable else we will set the value of C to the MAX variable. after that, we will write the value of MAX to the output screen and the Exit from the program.
[br]
Also, Read
  1. Algorithm to Add [Sum] two numbers
  2. Algorithm to Find Maximum of Two Numbers
  3. Algorithm to Input percentage From user and Print grade
  4. Algorithm to Print the Series 1 to N using for loop
  5. Algorithm to Print the Series 1 to N using while loop
  6. Algorithm to Print the Series 1 to N using Do While loop
  7. Algorithm to Reverse a given Number
  8. Algorithm to Find Whether a Number is Prime or Not
  9. Algorithm for Linear Search in Array
  10. Algorithm to Calculate Factorial using Function
algorithms algorithm

Post navigation

Previous post
Next post

Leave a Reply

Your email address will not be published. Required fields are marked *

  • HackerRank Dynamic Array Solution in Python
  • HackerRank 2D Array DS solution in Python
  • HackeRank Array – DS solution in Python
  • Streaming Demystified: How Much Data Does Your Favorite Show Really Use?
  • Parenthesis Matching program in C programming
  • HackerRank Dynamic Array Solution in Python
  • HackerRank 2D Array DS solution in Python
  • HackeRank Array – DS solution in Python
  • Streaming Demystified: How Much Data Does Your Favorite Show Really Use?
  • Parenthesis Matching program in C programming
  • About US
  • Contact US
  • Data Structures and algorithms tutorials
  • Digital Communication Tutorials
  • DMCA
  • HackerRank All Algorithms problems solutions
  • HackerRank C problems solutions
  • HackerRank C++ problems solutions
  • HackerRank Java solutions
  • HackerRank Python solutions
  • Human Values Tutorials
  • Internet of Things Tutorials
  • Privacy Policy
©2025 DATA STRUCTURE | WordPress Theme by SuperbThemes