Example
#include<stdio.h>
#include<conio.h>
void main()
{
int row,column,y,n,p,x;
clrscr();
printf("\nENTER THE NUMBER OF ROW = ");
scanf("%d",&n);
x=n;
row=1;
printf("\n\tMULTIPLICATION TABLE\n");
printf("-----------------------------\n");
do
{
column=1;
do
{
y=row*column;
printf("%4d",y);
column=column+1;
}
while(column<=n);
printf("\n");
row=row+1;
}
while(row<=x);
printf("------------------------------\n");
getch();
}
/*========================================================================
OUTPUT
ENTER THE NUMBER OF ROW = 5
MULTIPLICATION TABLE
-----------------------------
1 2 3 4 5
2 4 6 8 10
3 6 9 12 15
4 8 12 16 20
5 10 15 20 25
------------------------------ */
#include<stdio.h>
#include<conio.h>
void main()
{
int row,column,y,n,p,x;
clrscr();
printf("\nENTER THE NUMBER OF ROW = ");
scanf("%d",&n);
x=n;
row=1;
printf("\n\tMULTIPLICATION TABLE\n");
printf("-----------------------------\n");
do
{
column=1;
do
{
y=row*column;
printf("%4d",y);
column=column+1;
}
while(column<=n);
printf("\n");
row=row+1;
}
while(row<=x);
printf("------------------------------\n");
getch();
}
/*========================================================================
OUTPUT
ENTER THE NUMBER OF ROW = 5
MULTIPLICATION TABLE
-----------------------------
1 2 3 4 5
2 4 6 8 10
3 6 9 12 15
4 8 12 16 20
5 10 15 20 25
------------------------------ */
No comments:
Post a Comment