Search

Wednesday, October 29, 2014
0 comments

Design an algorithm to compare two numbers

11:55 PMWednesday, October 29, 2014
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


Protected by Copyscape Online Copyright Protection Software

0 comments :

Post a Comment

 
Toggle Footer
Top