Skip to content

Latest commit

 

History

History
32 lines (26 loc) · 792 Bytes

File metadata and controls

32 lines (26 loc) · 792 Bytes

Multiplication-Table

  • This program show the multiplication table of any number up to a any number you choose.

Needed

  • A program to run C files
  • Or a online c compiler

How to?

  • Download the release in here and run it.
  • or copy the code below and paste it on a online compiler and run it.
#include <stdio.h>
int main() {

  int n, i, range;
  printf("Enter an integer: ");
  scanf("%d", &n);

  // prompt user for positive range
  do {
    printf("Enter the range (positive integer): ");
    scanf("%d", &range);
  } while (range <= 0);

  for (i = 1; i <= range; ++i) {
    printf("%d * %d = %d \n", n, i, n * i);
  }

  return 0;
}

Remember to give a star 🌟 if you used this and got it as useful.