Print the multiplication table for a given number
Accepts any number provided by the user that needs to be formed into a multiplication
Starting from the value of I, multiply the given number (=1)
Increment the given number and the value of I until the value of I is less than or equal to 12.
/* Program to print the multiplication table of a given number */ #include <stdio.h> int main() { int number, i; clrscr(); printf("Please enter any number to find multiplication table:"); scanf("%d", &number); printf("Multiplication table for the given number %d: ", number); printf("</p><p>"); for(i=1;i<=12;i++){ printf("%d x %d = %d", number, i, number * i); printf("</p><p>"); } getch(); return 0; }
The above is the detailed content of Print the multiplication table of a given number in C. For more information, please follow other related articles on the PHP Chinese website!