Wednesday, July 20, 2011

Program to print table Horizontally

/*Serial No.63     [swami36.cpp]*/

#include<stdio.h>
#include<conio.h>
void main()
{
int i,j,num;
clrscr();
printf("Enter the no up to which you want table==>");
scanf("%d",&num);
for(i=1;i<=num;i++)
{
for(j=1;j<=10;j++)
{
printf("%d\t",i*j);
}
printf("\n");
}
getch();
}


OUTPUT :
Enter the no up to which you want table==>5
1        2       3       4        5        6        7        8        9       10
2       4       6       8       10       12      14      16      18      20
3       6       9      12      15       18      21      24      27      30
4       8       12    16      20      24      28      32      36      40
5      10      15    20     25      30      35      40      45      50

No comments:

Post a Comment

If you have any doubt, feel free to ask...