Write a program in C to display the multiplication table of a given integer. Go to the editor
Test Data :
Input the number (Table to be calculated) : 15
Expected Output :
15 X 1 = 15
...
...
15 X 10 = 150
#include <stdio.h>
#include <stdlib.h>
int main(){
int number,i;
printf("Input the number (Table to be calculated): ");
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