Tuesday, 8 September 2020

Program to find the multiplication table of a number

/*A program to find multiplication table*/
#include <stdio.h>
int main()
{
  int num, result,i;
  printf("Enter the number of which you want to get a multiplication table:");
  scanf("%d",&num);
  for(i=1;i<=10;i++)
  {
  result=num*i;
  printf("%d*%d=%d",num,i,result);
}
}

Output:



Description:
In this program, we ask the user to input a number and using the for loop we initialize the value of i and we calculate the table and display the result.


Try it yourself:
Write a program to check weather the person is eligible to vote or not.

1 comment:

If you have any doubt, please ask in the comment section.

Search This Blog

Program to print weather the number is happy or not.

#include <stdio.h> #include <math.h> int main () { int i , j , num , temp , sum = 0 ; printf ( "Enter number\n...