Algorithm to print number in reverse order.

Q7. Obtain an algorithm to print number from 160 to 1, that is, in reverse order.

Ans.

Integer num;

num<-160;

print ‘The number from 160 to 1, that is, in reverse order are:\n’;

while(num>0)

//while(num)

{

print ‘\t’ num;

num<-num-1;

}

Leave a Reply

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

105 Views
%d bloggers like this: