C Program to print multiplication table of m up to n using While loop

C Program to print multiplication table of m up to n using While loop

Write C Program to print multiplication table of m up to n using While loop

//WAP to print the multiplication table of m up to n

#include <stdio.h>

int main()
{
	int m,n;
	printf("Enter m :--> ");
	scanf("%d", &m);

	printf("Enter n :--> ");
	scanf("%d", &n);

	int i = 1;
	while(i <= n)
	{
		printf(" %d * %d = %d\n", m, i, m*i);
		i++;
	}
	return 0;
}

Output:

Enter m :--> 7
Enter n :--> 13
 7 * 1 = 7
 7 * 2 = 14
 7 * 3 = 21
 7 * 4 = 28
 7 * 5 = 35
 7 * 6 = 42
 7 * 7 = 49
 7 * 8 = 56
 7 * 9 = 63
 7 * 10 = 70
 7 * 11 = 77
 7 * 12 = 84
 7 * 13 = 91