Friday, March 28, 2014

C-Program to Get table of any number

Sample OUTPUT
Enter any number = 2
2 * 1 = 2
2 * 2 = 4
2 * 3 = 6
2 * 4 = 8
2 * 5 = 10
2 * 6 = 12
2 * 7 = 14
2 * 8 = 16
2 * 9 = 18
2 *10 = 20

#include<stdio.h>
#include<stdlib.h>
void line()
{
int i,j;
printf("\n");
for(i=1;i<=42;i++)
printf("=");
}
void header()
{
printf("\n");
printf("Built and Designed by Arslan Malik\n\n www.CworldbyAS.blogspot.com");
printf("\n");
}
int main()
{
line();
header();
line();

int r , num=1;
printf("\nEnter Number : ");
scanf("%d",&num);

for(r=1;r<=10;r++){

printf("%d * %d = %d\n",num,r,num*r);}
getch();
return 0;
}

No comments:

Post a Comment