#include
int main()
{
int table_size = 5;
int row = 0;
int col = 0;
clrscr();
textcolor(GREEN);printf("Multiplication Table\n");
for(col=0 ; col<=table_size ; col++)
{
printf(""); /*printf("%d", col);*/
}
for(row = 0 ; row<=table_size ; row++)
{
printf("\n");
for(col = 0 ; col<=table_size ; col++)
{
if(row == 0)
{
if(col == 0)
{
printf(" ");
}
else
{
printf(" |%d", col);
}
}
else
{
if(col == 0)
{
printf(" %d", row);
}
else
{
printf(" |%d", row*col);
}
}
}
}
printf("\n");
getch();
}
No comments:
Post a Comment