About Me

My photo
Davao City, Philippines, Philippines
HaI aDD ko NInu B..sA AkoANG MgA EMaIL ad.. Friendster: anica04@yahoo.com Multiply: shakugan @yahoo.com Perspot: veronicardo@yahoo.com Facebook: shakugan@yahoo.com Yahoo Messenger: veronicarebay@rocketmail.com Tnx..! AnD My NO. is 09284371521 TxtMeYt Ta nInU ha..HEHehEHe

Wednesday, February 18, 2009

"EXERCISES 8"







#include
#include
#include
void menu();
void nextscreen();
void nextscreen2();
void nextscreen()
{

clrscr();
int x,y,z;for(x=1;x<=77;x++)
{
gotoxy(2+x,1);textcolor(LIGHTRED);
cprintf("Í");//delay (10);
gotoxy(2+x,21);textcolor(LIGHTRED);
cprintf("Í");//delay (10);
}
for(y=1;y<=20;y++)
{
gotoxy(3,1+y);textcolor (LIGHTRED);
cprintf("º");//delay (10);gotoxy(79,1+y);textcolor (LIGHTRED);
cprintf("º");//delay (10);}gotoxy(3,1);textcolor (LIGHTRED);
cprintf("É");gotoxy(3,21);textcolor (LIGHTRED);
cprintf("È");gotoxy(79,1);textcolor (LIGHTRED);
cprintf("»");gotoxy(79,21);textcolor (LIGHTRED);
cprintf("¼");
}
void menu(){nextscreen();nextscreen2 ();
int choice,a,b,n,y,sum=0,sub=0,mul=0,div=0,z;
gotoxy (26,6);textcolor(LIGHTRED);
cprintf("\nSelect operation:");
gotoxy(25,8);textcolor(LIGHTGREEN);
cprintf("\n\t[A] for ADDITION");
gotoxy (25,9);textcolor(LIGHTGREEN);
cprintf("\n\t[B] for SUBTRACTION");
gotoxy(25,10);textcolor (LIGHTGREEN);
cprintf("\n\t[C] for MULTIPLICATION");
gotoxy(25,11);textcolor(LIGHTGREEN);
cprintf("\n\t[D] for DIVISION");
gotoxy (25,12);textcolor(LIGHTGREEN);
cprintf("\n\t[E] for EXIT");
gotoxy(25,14);textcolor(LIGHTGREEN);
cprintf("\nEnter choice here:");scanf("%s",&choice);switch(choice)
{case 'A':
clrscr();
nextscreen();nextscreen2();
gotoxy(35,5);textcolor(RED);
cprintf ("A] A D D I T I O N");
gotoxy(25,7);textcolor(LIGHTRED);
cprintf ("Enter number:");scanf("%d",&a);
gotoxy(25,8); textcolor (LIGHTRED);
cprintf("Enter another number:");
scanf("% d",&b); sum=a+b;
gotoxy(25,10);textcolor (LIGHTGREEN+BLINK);
cprintf("Sum of two number is: % d",sum);
gotoxy(25,14);textcolor(LIGHTBLUE);
cprintf("Do you want to try again,y/n?");
scanf("%s",&z);menu();getch();break;
}
switch(choice)
{case 'B':
clrscr();nextscreen();nextscreen2 ();
gotoxy(35,5);textcolor(YELLOW);
cprintf("B] S U B T R A C T I O N");
gotoxy(25,7);textcolor(LIGHTRED);
cprintf("Enter number:");scanf("%d",&a);
gotoxy(25,8);textcolor (LIGHTRED);
cprintf("Enter another number:");scanf("% d",&b);sub=a-b;gotoxy(25,10);
textcolor(YELLOW+BLINK);
cprintf ("DIFFERENCE of two number is: %d",sub);
gotoxy (25,14);textcolor(LIGHTBLUE);
cprintf("Do you want to try again,y/n?");
scanf("%s",&z);menu();getch();break;
}
switch(choice)
{case 'C':
clrscr();nextscreen();nextscreen2();gotoxy (35,5);textcolor(YELLOW);
cprintf("C] M U L T I P L I C A T I O N");
gotoxy(25,7);textcolor(LIGHTRED);
cprintf("Enter number:");
scanf("%d",&a);
gotoxy(25,8);textcolor (LIGHTRED);
cprintf("Enter another number:");
scanf("% d",&b);mul=a*b;
gotoxy(25,10);textcolor(YELLOW+BLINK);
cprintf ("PRODUCT of two number is: %d",mul);
gotoxy(25,14);textcolor(GREEN);
cprintf("Do you want to try again,y/n?");
scanf("% s",&z);menu();getch();break;
}
switch(choice)
{
case 'D':
clrscr();nextscreen();nextscreen2 ();
gotoxy(35,5);textcolor(YELLOW);
cprintf("D] D I V I S I O N");
gotoxy(25,7);textcolor(LIGHTRED);
cprintf("Enter number:");scanf("%d",&a);
gotoxy(25,8);textcolor (LIGHTRED);
cprintf("Enter another number:");
scanf("% d",&b);div=a/b;gotoxy(25,10);textcolor(YELLOW+BLINK);
cprintf ("QOUTIENT of two number is: %d",div);
gotoxy(25,14);textcolor (LIGHTGREEN);
cprintf("Do you want to try again,y/n?");
scanf("% s",&z);menu();getch();break;
}
switch(choice)
{
case'E':
gotoxy(15,18);textcolor(LIGHTCYAN);
cprintf("\n\nThe program ends here.. THANK YOU!");
}
}
void nextscreen2(){clrscr();int a,b,x,y,z;for(x=1;x<=77;x++){
gotoxy(2+x,1);
textcolor(LIGHTCYAN);
cprintf ("Í");gotoxy(2+x,21);textcolor(LIGHTCYAN);
cprintf("Í");}for (y=1;y<=20;y++){
gotoxy(3,1+y);textcolor(LIGHTCYAN);
cprintf ("º");gotoxy(79,1+y);textcolor(LIGHTCYAN);
cprintf("º");}gotoxy (3,1);textcolor(LIGHTCYAN);
cprintf("É");gotoxy(3,21);textcolor (LIGHTCYAN);
cprintf("È");gotoxy(79,1);textcolor (LIGHTCYAN);
cprintf("»");gotoxy(79,21);textcolor (LIGHTCYAN);
cprintf("¼");for(a=1;a<=49;a++){
gotoxy (15+a,4);textcolor (LIGHTCYAN);
cprintf("ß");gotoxy (15+a,17);textcolor(LIGHTCYAN);
cprintf("Ü");}for (b=1;b<=14;b++){
gotoxy(16,3+b);textcolor(LIGHTCYAN);
cprintf ("°");gotoxy(65,3+b);textcolor(LIGHTCYAN);
cprintf("° ");}
}
void main(){clrscr();nextscreen();nextscreen2();menu();


getch();

}

Monday, February 16, 2009

EXERCISES 5


#include
#include

void main()
{
clrscr();

float grade, average, sum, a=0

while (grade!=-1)
{
sum= sum + grade;
printf("Enter Grade;-1 to exit;");
scanf("% f, & grade);

if(grade = = -1){
printf("The average is %.2f \n", average = sum /a );)
a+ + ;}
if(average >= 95 && average < = 100){ printf("Rated A");} if (average > = 85 && average < = 94){ printf ("Rated B");} if (average >=75 && average < = 84){ printf ("Rated C");} if (average < = 74){ printf ("Failed");} getch(); }

Friday, February 13, 2009

EXERCISES 1



#include
#include

void main()
{
clrscr();
printf("Hello World!! Welcome to the WORLD of PROGRAMMING!!")

getch();
}

Thursday, February 12, 2009

EXERCISES 6


#include
#include

int num1,num2,ans;
int operation;
void main(){
clrscr();
gotoxy(20,5);
printf("W\tE\tL\tC\tO\tM\tE"); gotoxy(30,7);textcolor(WHITE);cprintf("Enter Number 1:");
scanf("%d",&num1);
gotoxy(30,8);textcolor(WHITE);cprintf("Enter Number 2:");
scanf("%d",&num2);
gotoxy(24,10);textcolor(WHITE);cprintf("A.) Addition \n");
gotoxy(24,11);textcolor(WHITE);cprintf("B.) Subtraction \n");
gotoxy(24,12);textcolor(WHITE);cprintf("C.) Multiplication \n");
gotoxy(24,13);textcolor(WHITE);cprintf("D.) Division \n");
gotoxy(24,14);textcolor(WHITE);cprintf("Enter a Number above for the Operation:");
scanf("%d",&operation);
switch(operation)
{
case 1:
ans=num1+num2;
gotoxy(30,16);textcolor(WHITE);cprintf("The Answer is: %d",ans);
break;
case 2:
ans=num1-num2;
gotoxy(30,16);textcolor(WHITE);cprintf("The Answer is: %d",ans);
break;
case 3:
ans=num1*num2;
gotoxy(30,16);textcolor(WHITE);cprintf("The Answer is: %d",ans);
break;
case 4:
ans=num1/num2;
gotoxy(30,16);textcolor(WHITE);cprintf("The Answer is: %d",ans);
break;
default:
gotoxy(30,15);textcolor(WHITE+BLINK);cprintf("Invalid Number!! Try
Again!!");
}
getch();
}

Exercises 3


#include
#include
int salary, years, bonus;
void main()
{
clrscr();
printf("Enter Salary:");
scanf("%d", &salary);
printf("Enter Years of Service:");
scanf("%d", &years);
bonus=0;
if (years==1){
bonus=salary*0.10;
printf("Bonus: %d", bonus);
}
else if ((years<=5) && (years>=2)){
bonus=salary*0.20;
printf("Bonus: %d", bonus);
}
else if ((years<=10) && (years>=6)){
bonus=salary*0.50 ;
printf("Bonus: %d", bonus);
}
else if (years<=11){ bonus=salary*0.75; printf("Bonus: %d", bonus); } getch(); }

Wednesday, February 11, 2009

EXERCICES 4


#include
#include

void main()
{
int a, b, c;
int choice;

clrscr();
printf("\n Enter a number: ");
scanf("%d", &a);
printf("\n\t\t[A] - Pattern 1\n\n");
printf("\t\t[B] - Pattern 2\n\n");
printf("\t\t[C] - Pattern 3\n\n");
printf("\t\t[D] - Pattern 4\n\n");

printf("Select your choice: ");
scanf("%s",&choice);

switch (choice)
{
case 'A':
printf("\n ");
for(b=1; b<=a; b++) { for(c=1; c<=b; c++) printf("*"); printf("\n "); } break; case 'B': printf("\n "); for(c=a; c>=1; c--)
{
for(b=1; b<=c; b++) printf("*"); printf("\n "); } break; case 'C': printf("\n "); for(b=1; b<=a; b++) { for(c=1; c<=(a-b); c++) printf(" "); for(c=1; c<=b; c++) printf("*"); printf("\n "); } break; case 'D': printf("\n "); for(int b=a-1; b>=0; b--)
{
for(int c=b; c
printf(" ");
for(int d=0; d<=b; d++) printf("*"); printf("\n "); } break; default: clrscr(); printf("\n\n\n\n\t\t\tYour choice is not available!\n\n\n\n\t\t\tTry again later...!!!"); } getch(); }

Exercise 2


#include
#include

void main()
{
clrscr();
printf("\t\tMy name is Veronica Rebay. I am 16 years old. My birthday is June 04, 1992");
printf("My religion is a roman catholic. My zodiac sign is a GEMINI.");
printf("I am taking the course of BS Information Technology.I live in the Matina Times Beach Davao City.");
printf("I have only one sister, her name is Michelle Rebay. She is now in High School in 2nd year.");
printf("My mother's name is Lucita Rebay, and my father's name is Lucita rebay.");
printf("My mother's work is she is the manager of the R.D.L., and my father is an electrical technician.");
printf("My hobbies is somesimes biking and somestimes watching T.V.");
printf("My favorite sports is chess, volleyball and badminton.");
printf("That's all..about of my autobiography.");
getch();
}