Program in C++ to print table 1 to any number using Function
#include<iostream> #include<iomanip> #include<conio.h> int Table(int x) { int i,j; for(i=1;i<=10;i++) { for(j=1;j<=x;j++) std::cout<<std::setw(4)<<i*j; std::cout<<std::endl; } } int main() { int n; std::cout<<" Enter a number:-"; std::cin>>n; Table(n); getch(); }Output:-
0 Comments