Answer to Question #16430 in C++ for arif hussain

Question #16430
Q#1 Write a program to pass a number as argument to the function body. Print the table of that number in the function body
1
Expert's answer
2012-10-16T09:42:19-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
APPROVED BY CLIENTS