Design an algorithm to compare two numbers

Input : Two numbers that are to be compared
Output : Messages of comparison

COMPARE (N1, N2)
[N1 and N2 are the numbers]
If(N1==N2) Then :
Write : 'Both the numbers are equal'
Else:
If (N1<N2) Then:
Write : 'First number is smaller then second number'
Else:
Write : 'First number is bigger number than second number'
[End of If]
[End of If]
Exit


Design an algorithm to compare two numbers Design an algorithm to compare two numbers Reviewed by Jacob Lefore on October 29, 2014 Rating: 5

No comments