C++ Program to Print Table of Any Number
- using namespace std;
- int main()
- int i,n;
- cout<<"Enter any number:";
- cin>>n;
- for(i=1;i<=10;++i)
- cout<<" "<<n<<" * "<<i<<" = "<<n*i;
- return 0;
Similarly, it is asked, how do you write a factorial in C++?
Factorial Program using Loop
- #include <iostream>
- using namespace std;
- int main()
- {
- int i,fact=1,number;
- cout<<"Enter any Number: ";
- cin>>number;
- for(i=1;i<=number;i++){
Also Know, what is do while in CPP?
C++ dowhile Loop
- The body of the loop is executed at first.
- If the condition evaluates to true , the body of the loop inside the do statement is executed again.
- The condition is evaluated once again.
- If the condition evaluates to true , the body of the loop inside the do statement is executed again.
How do you make a multiplication table in C++?
C++ Program to Find the Multiplication Table Of a Given number
- #include<iostream>
- using namespace std;
- int main()
- {
- int num;
- cout<<"Enter Number To Find Multiplication table ";
- cin>>num;
- for(int a=1;a<=10;a++)
How do you write multiplication in C++?
Example: c++ program to multiply two numbers
- #include <iostream> using namespace std;
- int main()
- { int x, y, multiplication;
- cout << "Enter two integers for multiplication: ";
- cin >> x >> y;
- // stored result in third variable. multiplication = x * y;
- // Prints multiplication value.