#include
#include
/* using while */
void main()
{
int i,num1,num2;
int row;
char ans='y';
while(ans=='y'||ans=='Y')
{
i=1;
row=7;
clrscr();
/* drawing top bar using loop */
textattr(30);
while(i<=79)
{
/* gotoxy(column,row); */
gotoxy(i,1);
cprintf("%c",219);
i++;
}
textattr(31);
gotoxy(2,1);
cprintf(" Table Generator Ver 1.0 ");
gotoxy(60,1);
cprintf(" Created By : IGCT,INFO Computers ");
i=1;
/* drawing bottom bar using loop */
textcolor(30);
while(i<=79)
{
gotoxy(i,24);
cprintf("%c",219);
i++;
}
gotoxy(30,5);
num2=num1;
while(num1<=num2*10)
{
gotoxy(35,row);
printf("³%6d³",num1);
num1=num1+num2;
row++;
}
gotoxy(20,20);
printf("Want to enter another number (Y/N) ?");
ans=getche();
}
getch();
}
#include
/* using while */
void main()
{
int i,num1,num2;
int row;
char ans='y';
while(ans=='y'||ans=='Y')
{
i=1;
row=7;
clrscr();
/* drawing top bar using loop */
textattr(30);
while(i<=79)
{
/* gotoxy(column,row); */
gotoxy(i,1);
cprintf("%c",219);
i++;
}
textattr(31);
gotoxy(2,1);
cprintf(" Table Generator Ver 1.0 ");
gotoxy(60,1);
cprintf(" Created By : IGCT,INFO Computers ");
i=1;
/* drawing bottom bar using loop */
textcolor(30);
while(i<=79)
{
gotoxy(i,24);
cprintf("%c",219);
i++;
}
gotoxy(30,5);
/* printing number table using while */
printf("Enter Number :");
scanf("%d",&num1);printf("Enter Number :");
num2=num1;
while(num1<=num2*10)
{
gotoxy(35,row);
printf("³%6d³",num1);
num1=num1+num2;
row++;
}
gotoxy(20,20);
printf("Want to enter another number (Y/N) ?");
ans=getche();
}
getch();
}
No comments:
Post a Comment