Tuesday, March 24, 2009


My autobiography
#include
#include
#define p printf
#define s scanf


main()

{

clrscr();

textcolor(RED);gotoxy(35,1);
p("My Autobiography");
gotoxy(29,2);
cprintf("My name is Arthur Ray A. Ochada ");
gotoxy(20,3);
cprintf("I live in 22-056 Lanzona subd. Calinan Davao City");
gotoxy(15,4);
cprintf("I was born on October 24,1991 in Limso Hospital in Davao City");
gotoxy(24,9);
p("My mother's name is Angelita A. Ochada");
gotoxy(25,10);
p("My father's name is Arturo N. Ochada");
gotoxy(28,11);
p("I have 5 sisters and 1 brother");

getch();


}

Thursday, February 19, 2009

calculator


#include
#include
#include
#include


void swtch();
void frme();
void ext();
void loop();

void main(){



clrscr();
frme();
loop();
swtch();
getche();

}

void frme()
{

int x,y;

for(x=1;x<=77;x++){ gotoxy(1,1);textcolor(GREEN);cprintf("Î"); gotoxy(1+x,1);textcolor(GREEN);cprintf("Î"); gotoxy(1+x,25);textcolor(GREEN);cprintf("Î"); gotoxy(1,25);textcolor(GREEN);cprintf("Î"); } for(y=1;y<=23 ;y++){ gotoxy(1,1+y);textcolor(GREEN);cprintf("Î"); gotoxy(78,1);textcolor(GREEN);cprintf("Î"); gotoxy(78,1+y);textcolor(GREEN);cprintf("Î"); gotoxy(78,1);textcolor(GREEN);cprintf("Î"); } for(x=5;x<=72;x++){ gotoxy(5,3);textcolor(GREEN);cprintf("Î"); gotoxy(1+x,3);textcolor(GREEN);cprintf("Î"); gotoxy(1+x,23);textcolor(GREEN);cprintf("Î"); gotoxy(5,23);textcolor(GREEN);cprintf("Î"); } for(y=1;y<=19 ;y++){ gotoxy(5,3+y);textcolor(GREEN);cprintf("Î"); gotoxy(73,3);textcolor(GREEN);cprintf("Î"); gotoxy(73,3+y);textcolor(GREEN);cprintf("Î"); gotoxy(73,23);textcolor(GREEN);cprintf("Î"); } } void swtch() { clrscr(); frme(); int A,B,C,D,choice; gotoxy(33,6);textcolor(RED+BLINK);cprintf("W E L C O M E"); gotoxy(32,8);textcolor(YELLOW);cprintf("[1]. ADDITION"); gotoxy(32,10);textcolor(YELLOW);cprintf("[2]. SUBTRACTION"); gotoxy(32,12);textcolor(YELLOW);cprintf("[3]. MULTIPLICATION"); gotoxy(32,14);textcolor(YELLOW);cprintf("[4]. DIVISION"); gotoxy(32,16);textcolor(YELLOW);cprintf("[5]. E X I T"); gotoxy(32,18);textcolor(WHITE);cprintf("Enter the number of choice:"); scanf("%d",&choice); switch(choice){ case 1: clrscr(); frme(); int num1,num2,ans; gotoxy(34,6);textcolor(YELLOW+BLINK);cprintf("ADDITION"); gotoxy(32,8);textcolor(RED);cprintf("Enter 1st:"); scanf("%d",&num1); gotoxy(32,9);textcolor(RED);cprintf("Enter 2nd:"); scanf("%d",&num2); ans=num1+num2; gotoxy(32,10);textcolor(YELLOW);cprintf("Sum is: %d",ans); getche(); clrscr(); loop(); frme(); swtch(); break; case 2: clrscr(); frme(); int e,s,diff; gotoxy(33,6);textcolor(YELLOW+BLINK);cprintf("SUBTRACTION"); gotoxy(32,8);textcolor(RED);cprintf("Enter 1st:"); scanf("%d",&e); gotoxy(32,9);textcolor(RED);cprintf("Enter 2nd:"); scanf("%d",&s); diff=e-s; gotoxy(32,10);textcolor(YELLOW);cprintf("Diff is: %d",diff); getche(); clrscr(); loop(); frme(); swtch(); break; case 3: clrscr(); frme(); int l,k,prod; gotoxy(33,6);textcolor(YELLOW+BLINK);cprintf("MULTIPLICATION"); gotoxy(32,8);textcolor(RED);cprintf("Enter 1st:"); scanf("%d",&l); gotoxy(32,9);textcolor(RED);cprintf("Enter 2nd:"); scanf("%d",&k); prod=l*k; gotoxy(32,10);textcolor(YELLOW);cprintf("Prod is: %d",prod); getche(); clrscr(); loop(); frme(); swtch(); break; case 4: clrscr(); frme(); int o,u,quo; gotoxy(34,6);textcolor(WHITE+BLINK);cprintf("DIVISION"); gotoxy(32,8);textcolor(BLUE);cprintf("Enter 1st:"); scanf("%d",&o); gotoxy(32,9);textcolor(BLUE);cprintf("Enter 2nd:"); scanf("%d",&u); quo=o/u; gotoxy(32,10);textcolor(WHITE);cprintf("Quo is: %d",quo); if("Qou<=0") printf(" connot be"); getche(); clrscr(); loop(); frme(); swtch(); break; case 5: clrscr(); loop(); ext(); exit(1); getche(); break; default: clrscr(); loop(); frme(); gotoxy(32,12);textcolor(RED+BLINK);cprintf("ÞÞÞERRORÞÞÞ"); } } void ext() { clrscr(); int l,m; for(l=1;l<=65;l++) { gotoxy(6+l,7);printf(""); gotoxy(72-l,18);printf(""); delay(20); } { gotoxy(31,13);textcolor(RED);cprintf("Program termination"); gotoxy(31,14);textcolor(BLUE+BLINK);cprintf("Press Any Key"); getche(); } } void loop() { for(int e=1;e<=25;e++){ gotoxy(27+e,24);textcolor(YELLOW);cprintf("Þ"); } gotoxy(27,23);textcolor(WHITE+BLINK);cprintf("LOADING......"); gotoxy(40,23);textcolor(YELLOW);cprintf("(Please Wait)"); for(int i=1;(i<=25*4);i++) { gotoxy(27+(i/4),24);textcolor(RED);cprintf("±"); gotoxy(54,24);textcolor(6);cprintf("%d%",i); delay(40); } for(int o=1;o<=25;o++) { gotoxy(27+o,24);textcolor(YELLOW);cprintf("²"); } }

Thursday, February 5, 2009

Average


Average



#include

#include
int x,grade,ave,a,b,c;
void main(){

clrscr();

printf("Enter grade, -1 to exit:");

scanf("%d",&a); printf("Enter grade, -1 to exit:");

scanf("%d",&b); printf("Enter grade, -1 to exit:");

scanf("%d",&c);

grade=a+b+c;

ave=grade/3;

printf("average is:%d",ave);
if(ave<=9) printf("\ninvalid input"); while (ave>=95)
printf("");
getch(); }

Tuesday, February 3, 2009

Programming codes


Grade

#include void swtch();
#include void frme();
#include void ext();
#include void loop();
void main(){

clrscr();
frme();
loop();
swtch();
getche();
}
void frme() {
int x,y;
for(x=1;x<=77;x++) { gotoxy(1,1);textcolor(GREEN); cprintf("Î"); gotoxy(1+x,1); textcolor(GREEN); cprintf("Î"); gotoxy(1+x,25); textcolor(GREEN); cprintf("Î"); gotoxy(1,25); textcolor(GREEN); cprintf("Î"); } for(y=1;y<=23 ;y++) { gotoxy(1,1+y); textcolor(GREEN); cprintf("Î"); gotoxy(78,1); textcolor(GREEN); cprintf("Î"); gotoxy(78,1+y); textcolor(GREEN); cprintf("Î"); gotoxy(78,1); textcolor(GREEN); cprintf("Î"); } for(x=5;x<=72;x++) { gotoxy(5,3); textcolor(GREEN); cprintf("Î"); gotoxy(1+x,3); textcolor(GREEN); cprintf("Î"); gotoxy(1+x,23); textcolor(GREEN); cprintf("Î"); gotoxy(5,23); textcolor(GREEN); cprintf("Î"); } for(y=1;y<=19 ;y++) { gotoxy(5,3+y); textcolor(GREEN); cprintf("Î"); gotoxy(73,3); textcolor(GREEN); cprintf("Î"); gotoxy(73,3+y); textcolor(GREEN); cprintf("Î"); gotoxy(73,23); textcolor(GREEN); cprintf("Î"); } } void swtch() { clrscr(); frme(); int A,B,C,D,choice; gotoxy(33,6); textcolor(RED+BLINK); cprintf("W E L C O M E"); gotoxy(32,8); textcolor(YELLOW); cprintf("[1]. ADDITION"); gotoxy(32,10); textcolor(YELLOW); cprintf("[2]. SUBTRACTION"); gotoxy(32,12); textcolor(YELLOW); cprintf("[3]. MULTIPLICATION"); gotoxy(32,14); textcolor(YELLOW); cprintf("[4]. DIVISION"); gotoxy(32,16); textcolor(YELLOW); cprintf("[5]. E X I T"); gotoxy(32,18); textcolor(WHITE); cprintf("Enter the number of choice:"); scanf("%d",&choice); switch(choice){ case 1: clrscr(); frme(); int num1,num2,ans; gotoxy(34,6); textcolor(YELLOW+BLINK); cprintf("ADDITION"); gotoxy(32,8); textcolor(RED); cprintf("Enter 1st:"); scanf("%d",&num1); gotoxy(32,9); textcolor(RED); cprintf("Enter 2nd:"); scanf("%d",&num2); ans=num1+num2; gotoxy(32,10); textcolor(YELLOW); cprintf("Sum is: %d",ans); getche(); clrscr(); loop(); frme(); swtch(); break; case 2: clrscr(); frme(); int e,s,diff; gotoxy(33,6); textcolor(YELLOW+BLINK); cprintf("SUBTRACTION"); gotoxy(32,8);textcolor(RED); cprintf("Enter 1st:"); scanf("%d",&e); gotoxy(32,9); textcolor(RED); cprintf("Enter 2nd:"); scanf("%d",&s); diff=e-s; gotoxy(32,10); textcolor(YELLOW); cprintf("Diff is: %d",diff); getche(); clrscr(); loop(); frme(); swtch(); break; case 3: clrscr(); frme(); int l,k,prod; gotoxy(33,6); textcolor(YELLOW+BLINK); cprintf("MULTIPLICATION"); gotoxy(32,8);textcolor(RED); cprintf("Enter 1st:"); scanf("%d",&l); gotoxy(32,9); textcolor(RED); cprintf("Enter 2nd:"); scanf("%d",&k); prod=l*k; gotoxy(32,10); textcolor(YELLOW);cprintf("Prod is: %d",prod); getche(); clrscr(); loop(); frme(); swtch(); break; case 4: clrscr(); frme(); int o,u,quo; gotoxy(34,6);textcolor(WHITE+BLINK);cprintf("DIVISION"); gotoxy(32,8);textcolor(BLUE);cprintf("Enter 1st:"); scanf("%d",&o); gotoxy(32,9);textcolor(BLUE);cprintf("Enter 2nd:"); scanf("%d",&u); quo=o/u; gotoxy(32,10);textcolor(WHITE);cprintf("Quo is: %d",quo); if("Qou<=0") printf(" connot be"); getche(); clrscr(); loop(); frme(); swtch(); break; case 5: clrscr(); loop(); ext(); exit(1); getche(); break; default: clrscr(); loop(); frme(); gotoxy(32,12);textcolor(RED+BLINK);cprintf("ÞÞÞERRORÞÞÞ"); } } void ext() { clrscr(); int l,m; for(l=1;l<=65;l++) { gotoxy(6+l,7);printf(""); gotoxy(72-l,18);printf(""); delay(20); } { gotoxy(31,13);textcolor(RED);cprintf("Program termination"); gotoxy(31,14);textcolor(BLUE+BLINK);cprintf("Press Any Key"); getche(); } } void loop() { for(int e=1;e<=25;e++){ gotoxy(27+e,24);textcolor(YELLOW);cprintf("Þ"); } gotoxy(27,23);textcolor(WHITE+BLINK);cprintf("LOADING......"); gotoxy(40,23);textcolor(YELLOW);cprintf("(Please Wait)"); for(int i=1;(i<=25*4);i++) { gotoxy(27+(i/4),24);textcolor(RED);cprintf("±"); gotoxy(54,24);textcolor(6);cprintf("%d%",i); delay(40); } for(int o=1;o<=25;o++) { gotoxy(27+o,24);textcolor(YELLOW);cprintf("²"); } }

About me


I'am arthur, i love to be in the military but i can't my parents wont let me be one of the military troops!When my Mother died I realized that I'am needed in our family more than the military do, so I decided to continue the course that I'am taking up which is "INFORMATION TECHNOLOGY".