Blog Moved

This website completely moved to new domain. For latest content, visit www.programmingposts.com

Search This Blog

17 Aug 2012

C Program to Print Multiplication Table of a given Number


/** C Program to Print Multiplication Table of a given Number **/
#include<stdio.h>
//#include<conio.h>
void main()
{
 int num,i;
 //clrscr();
 printf("\n >>> PROGRAM TO PRINT MULTIPLICATION TABLE <<<");
 printf("\n Enter the Number: ");
 scanf("%d",&num);
 printf("\n %d Multiplication Table",num);
 printf("\n ----------------------");
 for(i=1;i<=10;i++) //printing upto 10..
 {
     printf("\n %d * %d =  %d",num,i,(num*i));
     //the product of entered num and i value
 }
 printf("\n\n");
 //getch();
}

Sample Output:
 ( using GNU GCC Compiler with code::blocks IDE, hence no need of clrscr(); and getch(); )


2 comments: