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


Comments

Popular posts from this blog

difference between structure and union in C Language

Difference between Linear search and Binary Search in c language

Difference between static and dynamic websites