Print tables with no return type without using arguments in C


The program is a simple C program that prints out the multiplication table of a given number. The program starts with the main() function which calls the tables() function. The tables() function prompts the user to enter the table number and the limit (up to which the table should be printed). It then uses a for loop to iterate from 1 to the given limit, and for each iteration, it calculates the product of the current iteration number and the table number, and prints it out. The final output is the multiplication table of the given number, up to the given limit.

Source Code

#include<stdio.h>
void tables();
int main()
{
   tables();
   return 0;
}
void tables()
{
   int i,j,n;
   printf("\nEnter the Table number:");
   scanf("%d",&j);
   printf("\nEnter the limit:");
   scanf("%d",&n);
   for(i=1;i<=n;i++)
   {
      printf("\n%d*%d=%d",i,j,i*j);
   }
}
To download raw file Click Here

Output

Enter the Table number:7
Enter the limit:5
1*7=7
2*2=14
3*3=21
4*7=28
5*7=35


List of Programs


Sample Programs


Switch Case in C


Conditional Operators in C


Goto Statement in C


While Loop Example Programs


Looping Statements in C

For Loop Example Programs


Array Examples in C

One Dimensional Array


Two Dimensional Array in C


String Example Programs in C


Functions Example Programs in C