Computer Science, asked by rgs012070, 4 months ago

Program to accept a number from the user and print the table of that nnumber (please give input and output)​

Answers

Answered by Anonymous
77

\huge \sf \orange {\underline {\pink{\underline {A᭄ɴsᴡᴇʀ࿐ \ :- }}}}

\huge \purple{\fbox {\tt \blue{Input :}}}

// CPP program to print table of a number

#include <iostream>

using namespace std;

int main()

{

int n = 5; // Change here to change output

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

cout << n << " * " << i << " = "

<< n * i << endl;

return 0;

}

\huge \purple{\fbox {\tt \red{Output :}}}

5 * 1 = 5

5 * 2 = 10

5 * 3 = 15

5 * 4 = 20

5 * 5 = 25

5 * 6 = 30

5 * 7 = 35

5 * 8 = 40

5 * 9 = 45

5 * 10 = 50

Answered by anindyaadhikari13
3

Required Answer:-

Question:

  • Write a python program to accept a number from the user and print the table of that number.

Solution:

Here comes the program.

n=int(input("Enter an integer number:  "))

print("Here comes the table of",n)

for i in range(1,11):

print(n,"x",i,"=",n*i)

Algorithm:

  1. START.
  2. Accept a number.
  3. Iterate a loop in the range i = 1 to 11.
  4. Multiply each value of i with the number. Display the result.
  5. STOP.

See the attachment for output ☑.

Attachments:
Similar questions