C Online Compiler
Example: Multiplication Table for a Fixed Number in C
C
C++
C#
Java
Python
PHP
main.c
STDIN
Run
// Multiplication Table for a Fixed Number #include <stdio.h> int main() { // Step 1: Define the number for which the table is to be generated. int number = 9; // Example: Generate table for 9 // Step 2: Loop from 1 to 10 to multiply the number. printf("Multiplication Table for %d:\n", number); for (int i = 1; i <= 10; i++) { // Step 3: Calculate the product. int product = number * i; // Step 4: Print the result in a formatted way. printf("%d x %d = %d\n", number, i, product); } return 0; }
Output
Clear
ADVERTISEMENTS