3. Write a C program to input a number from user and print multiplication table of the given number using for loop.
#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));
}
}
Comments
Leave a comment