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>
#include <stdlib.h>
int main(){
int number,i;
printf("Input the number: ");
scanf("%d",&number);
for(i=1;i<=10;i++){
printf("%d X %d = %d\n",number,i,(i*number));
}
getchar();
getchar();
return 0;
}
Comments
Leave a comment