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.
#include<iostream>
using namespace std;
void displayTable(int res){
}
int main(){
int num,i,res;
cout<<"Enter the number: \n";
cin>>num;
for(int i=1;i<=10;i++){
res= num*i;
cout<<num<<"*"<<i<<"="<<res;
cout<<endl;
}
displayTable(res);
return 0;
}
Comments
Leave a comment