Sunday, 21 June 2015

C Program to Print a table of given number.

To print the table of given number.

Program:

#include<stdio.h>
#include<conio.h>

 void main()
{
   int i,a,b;  
//Declaring Variable.

   

   printf("Enter the Table number"); //For printing
   scanf("%d",&a); //For Input.
   
   printf("Till where you want to print the table"); //For printing
   scanf("%d",&b);  //For Input.
   
  for(i=1;i<=b;i++)  //for loop
  printf("\n %d*%d = %d",a,i,a*i); 
//For printing


  getch();  //Getting a character or waiting for key press
}
Output:


No comments:

Post a Comment