Answer to Question #274480 in C++ for Asif

Question #274480

3. Write a C program to input a number from user and print multiplication table of the given number using for loop.

1
Expert's answer
2021-12-06T02:18:13-0500
#include<stdio.h>
int main(){
	printf("Enter a number: ");
	int n;
	scanf("%d", &n);
	int i=0;
	printf("The multiplication table of %d is: ", n);
	for(i=1; i<=12; i++){
		printf("%d * %d = %d\n", i, n, (i*n));
	}
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment