495
In this example we will print a multiplication table in C using a number that a user inputs on the command line
Example
#include<stdio.h> int main() { int number,count; printf("Enter an integer : "); scanf("%d", &number); for(count = 1; count <= 10; count++) { printf("\n%d * %d = %d", number, count, number*count); } return 0; }
When you run this you will see something like this
Enter an integer : 8 8 * 1 = 8 8 * 2 = 16 8 * 3 = 24 8 * 4 = 32 8 * 5 = 40 8 * 6 = 48 8 * 7 = 56 8 * 8 = 64 8 * 9 = 72 8 * 10 = 80