You are on page 1of 2

Activity 2: Three color bar

CODE: OUTPUT:

// Name: RAVEN M. BERCASIO

// Section: BSITM21

#include<iostream.h>

#include<conio.h>

void main()

clrscr();

char p=219;

gotoxy(30,3);textcolor(RED);cprintf("%s",&p);

gotoxy(31,3);textcolor(YELLOW);cprintf("%s",&p);

gotoxy(32,3);textcolor(GREEN);cprintf("%s",&p);

gotoxy(30,4);textcolor(RED);cprintf("%s",&p);

gotoxy(31,4);textcolor(YELLOW);cprintf("%s",&p);

gotoxy(32,4);textcolor(GREEN);cprintf("%s",&p);

gotoxy(30,5);textcolor(RED);cprintf("%s",&p);

gotoxy(31,5);textcolor(YELLOW);cprintf("%s",&p);

gotoxy(32,5);textcolor(GREEN);cprintf("%s",&p);

getch();

}
ACTIVITY 3: Write a Program to calculate and display the volume (VOL) of a rectangular box having its

height (H=10cm), width (W=12cm) and depth (8cm).

CODE: OUTPUT:

#include<stdio.h>
#include<conio.h>

void main()
{
int h,w,d,v;
clrscr();
printf("Enter the height, width & depth \n");
scanf("%d%d%d",&h,&w,&d);
v=h*w*d;
printf("the Volume is %d",v);
getch();
}
FLOWCHART:

Initialize h,w,d,v

display message
"Enter height,
width, and depth:"

input h,w,d

v = h*w*d

display
"Volume is v"

END

You might also like