Write a C C++ program to generate multiplication table

Write a C C++ program to generate multiplication table

If statement और decision making statements के बारे में अधिक जानने के लिए देखें— If statements in C

C Language में Token क्या होता है जानने के लिए देखें—Data types in C

Looping और iterative statements के बारे में और अधिक जानने के लिए देखें— Looping statements in C

Flowchart to generate multiplication table

Multiplication table of given number flowchart

C program to generate multiplication table

#include<stdio.h>
int main()
{
    int num,c=1,res;
    printf("Enter a number: ");
    scanf("%d",&num);
    while(c<=10)
    {
        res=num*c;
        printf("%d*%d=%d\n",num,c,res);
        c++;
    }
    return 0;
}

C++ program to generate multiplication table

#include<iostream>
using namespace std;
int main()
{
    int num,c=1,res;
    cout<<"Enter a number: ";
    cin>>num;
    while(c<=10)
    {
        res=num*c;
        cout<<num<<"*"<<c<<"="<<res<<"\n";
        c++;
    }
    return 0;
}

Output of C C++ program to generate multiplication table

Enter a number: 5
5*1=5
5*2=10  
5*3=15  
5*4=20  
5*5=25  
5*6=30  
5*7=35  
5*8=40  
5*9=55  
5*10=50 
Enter a number: 5
12*1=12
12*2=24  
12*3=36  
12*4=48  
12*5=60  
12*6=72  
12*7=84  
12*8=96  
12*9=108  
12*10=120  

Important iteration logic programs in C C++

  1. Generate series of natural numbers (while, for, do while)
  2. Generate series of natural numbers and their sum
  3. Generate series of odd numbers and find their sum
  4. Generate series of even numbers and find their sum
  5. Generate table of given number
  6. Find factorial of given number
  7. Find power of given number
  8. HCF and LCM of two numbers
  9. Generating Fibonacci series
  10. Checking prime number
  11. Generating series of prime numbers
  12. Sum of digits of given number
  13. Reverse of digits of given number
  14. Checking palindrome number
  15. Checking Armstrong number
  16. Generating series of Armstrong numbers
  17. Convert decimal to binary
  18. Convert binary to decimal
Share it to:

Published by

admin

I am a computer teacher, programmer and web developer