UncleCoder.com

UncleCoder.com

Free programming examples and instructions

C program to generate Multiplication table using for loop

C program for how to generate multiplication table using for loop

by Krishna viswambharan


Posted on 24 Aug 2017 Category: C Views: 334

Edited on 25 Aug 2017



C program to generate multiplication table using 'for loop'

This program reads an integer from the user and generates the multiplication table up to the range given by the user.  

#include <stdio.h>
#include <conio.h>
void main()
{
    int n, i, r;

    printf("Enter the number : ");
    scanf("%d",&n);

    printf("Enter the range: ");
    scanf("%d", &r);

    for(i=1; i <= r;i++)
    {
        printf("%d * %d = %d \n", n, i, n*i);
    }

   getch();
}

Output



Leave a Comment:


Advertisement