- 2
write a c++ program to display the multiplication table of a number with 12 rows
6 Antworten
+ 3
#include <iostream>
using namespace std;
int main()
{
int num,i;
cout<<"Enter a number:\n ";
cin>>num;
cout<<"Entered number:"<<num<<endl;
for(i=1;i<13;i++)
{
cout<<num*i<<endl;
}
return 0;
}
+ 1
#include <iostream>
using namespace std;
int main( )
{
int a;
cout <<"Enter a number to generate it's multiplication table: ";
cin >> a;
for ( int b = 1; b <= 12; b++ )
cout << a << " * " << b << " = " << a*b << "\n" << endl;
return 0;
}
+ 1
I need the output of thi question
0
<#include iostream.h>
void main()
{ int i=1;
for(i=1;i<13;i++)
{
cout<<(n*i); /*here n is any number user wants the table of*/
return 0;
}
}
0
#include <iostream>
using namespace std;
int main() {
int n, term, i;
cout << "Enter a number to print multiplication table\n";
cin >> n;
cout << "Enter number of terms in table\n";
cin >> term;
/* Generate multiplication table */
for(i = 1; i <= term; ++i){
cout << n << " X " << i << " = " << n*i << endl;
}
return 0;
}
Above c program prints the multiplication table of any number till N rows. IN your case you need to enter number of terms as 12.
http://www.techcrashcourse.com/2016/03/cpp-program-to-print-multiplication-table.html
http://www.techcrashcourse.com/2015/08/c-program-print-multiplication-table-number.html
0
Write a C++ program to display the multiplication table of a given number having 12 raws.