Mon May 21 2018

Multiplication Table

C Programming955 views

File Name: times-table.c

#include<stdio.h>

int main() {
	int i, ans;
	printf("Four Times Table\n");

	/* loop the process using "For loop" */
	for(i=1; i<=10; i++) {
		ans = 4 * i;

		/* Print two variable at the same time */
		printf("4 X %d = %d\n",i,ans);
	}
	return 0;
}



/* Output */
Four Times Table
4 x 1 = 4
4 x 2 = 8
4 x 3 = 12
4 x 4 = 16
4 x 5 = 20
4 x 6 = 24
4 x 7 = 28
4 x 8 = 32
4 x 9 = 36
4 x 10 = 40

We use cookies to improve your experience on our site and to show you personalised advertising. Please read our cookie policy and privacy policy.