Computer Science, asked by divya757, 1 year ago

write an algorithm to print the table of 5​

Answers

Answered by charlie1505
3

Explanation:

Step 1:

Start

Step 2:

Input N, the number for which multiplication table is to be printed.

Step 3: For

T = 1 to 10

Step 4:

Print M = N * T

Step 5:

End For

Step 6: Stop

Answered by ssanskriti1107
0

Answer:

An algorithm is a finite sequence of exact instructions that is used in mathematics and computer science to solve a class of particular problems or carry out a computation.

Step1: Start

Step2: Input N=5

Step3: Input T=1 to 10

Step4: Print M=N*T

Step5: End

Where T is the table and N is the input number

Code:-

// Java program to print table of a number  

import java.io.*;

class table

{  

// Driver code

public static void main(String arg[])

{  

// Change here to change output

int n = 5;  

for (int i = 1; i <= 10; ++i)  

System.out.println(n + " * " + i +  " = " + n * i);

}

}

#SPJ2

Similar questions