Answer to Question #274635 in C++ for khan

Question #274635

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-06T05:27:18-0500
#include<stdio.h>


int main()
{
	int n;
	printf("Please, enter a number to create mutltiplication table: ");
	//Take input from user
	scanf("%d",&n);
	//Make loop from 1 to 10
	printf("This is mutltiplication table from 1 to 10:\n");
	for(int i=1;i<=10;i++)
	{
		printf("%d x %d = %d\n",n,i,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