Do what you want to

do,Dream what you want to dream, Go where you want to go, Be what you want to be, because you only have one life and one chance to do all the things you want to do...


Sunday, December 23, 2012

Buat sifir guna Turbo C++


#include<stdio.h>
#include<conio.h>
#define size_of_box 40

main()
{
 int time, number, answer, i, j;

 //top line
 printf("%c",201);
 for (i=0; i<size_of_box; i++)
printf("%c", 205);
 printf("%c", 187);

 /*sides of box*/
 for (i=0; i<size_of_box; i++)
 {
printf("\n%c", 186);

printf("    Enter number between 1 and 12: ");
scanf("%d",&time);
printf("\n%8d times multiplication table\n", time);
for(number=1; number<=12; number++)
 {
answer=number*time;
printf("\n%16d x %d = %d", number,time, answer);
 }
for (j=0; j<size_of_box; j++)

printf(" ");
printf("%c",186);
}

//bottom line
 printf("\n%c", 200);
 for (i=0; i<size_of_box; i++)
printf("%c", 205);
 printf("%c",188);
 getch();
 return(0);
}

No comments:

Post a Comment