Answer to Question #180273 in C++ for Almas rubi

Question #180273

Write a program that takes a number from the user and pass that number to a user defined function. The function displays the table of that number. (


1
Expert's answer
2021-04-11T05:18:11-0400
#include <iostream>

#include<conio.h>

using namespace std;

void table(int,int);

void main(void)

{

int num,i;

cout << "Enter the number : " << endl;

cin >> num;

cout << "Upto how many multiples of the given number do you want? " << endl;

cin >> i;

table(num,i);

getch();

}

void table(int num,int i)

{

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

printf("%5d * %5d = %5d",j,num,j*num);

}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS