Algorithm to print the table.

Q6. Write an algorithm to print the table of a given number n.

Ans.

Integer num, counter;

print ;Enter the number you want to print the table of: ‘;

read num;

for(counter<-1;counter<=10;counter<-counter+1)

{

print num ‘X’ counter,‘=’, num*counter;

}

Leave a Reply

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

129 Views
%d bloggers like this: