// C program for the
// above approach
#include <conio.h>
#include <graphics.h>
#include <stdio.h>
// Used Function Declaration
void menu_key();
void others();
void key();
void screen();
// Driver Code
void main()
{
int gd = DETECT, gm;
// Initialize of gdriver with
// DETECT macros
initgraph(&gd, &gm,
"C:\\turboc3\\bgi");
// Set Background Color As
// Darkgray
setfillstyle(SOLID_FILL,
DARKGRAY);
floodfill(1, 1, 15);
// Main Outline
rectangle(800, 100, 1100, 730);
// Set Phone Color AS Black
setfillstyle(SOLID_FILL, BLACK);
floodfill(805, 105, 15);
// Calling screen() Function
screen();
// Calling others() Function
others();
// Calling menu_key() Function
menu_key();
// Calling key() Function
key();
// Holding The Screen For
// A While
getch();
// Close the initialized
// gdriver
closegraph();
}
void screen()
{
// Screen Outline
rectangle(830, 130, 1070, 370);
// Screen Saver Indian Flag
rectangle(900, 170, 1000, 230);
line(900, 190, 1000, 190);
setfillstyle(SOLID_FILL,
LIGHTRED);
floodfill(905, 175, 15);
circle(950, 200, 10);
setfillstyle(SOLID_FILL, BLUE);
floodfill(955, 205, 15);
line(900, 190, 1000, 190);
line(900, 210, 1000, 210);
setfillstyle(SOLID_FILL, WHITE);
floodfill(905, 195, 15);
floodfill(995, 195, 15);
line(900, 210, 1000, 210);
setfillstyle(SOLID_FILL, GREEN);
floodfill(905, 215, 15);
line(900, 170, 900, 320);
rectangle(880, 320, 920, 330);
setfillstyle(SOLID_FILL, WHITE);
floodfill(885, 325, 15);
}
void key()
{
int l = 820, t = 500, i = 1;
// Implementing 12 Others Key
// and
// Numbering Them
while (t <= 650) {
while (l <= 1020) {
rectangle(l, t, l + 70,
t + 40);
if (i == 1) {
settextstyle(8, 0, 2);
outtextxy(l + 5, t + 5,
"1 ., ?");
}
else if (i == 2) {
settextstyle(8, 0, 2);
outtextxy(l + 5, t + 5,
"2 ABC");
}
else if (i == 3) {
settextstyle(8, 0, 2);
outtextxy(l + 5, t + 5,
"3 DEF");
}
else if (i == 4) {
settextstyle(8, 0, 2);
outtextxy(l + 5, t + 5,
"4 GHI");
}
else if (i == 5) {
settextstyle(8, 0, 2);
outtextxy(l + 5, t + 5,
"5 JKL");
}
else if (i == 6) {
settextstyle(8, 0, 2);
outtextxy(l + 5, t + 5,
"6 MNO");
}
else if (i == 7) {
settextstyle(8, 0, 2);
outtextxy(l + 5, t + 5,
"7PQRS");
}
else if (i == 8) {
settextstyle(8, 0, 2);
outtextxy(l + 5, t + 5,
"8 TUV");
}
else if (i == 9) {
settextstyle(8, 0, 2);
outtextxy(l + 5, t + 5,
"9WXYZ");
}
else if (i == 10) {
settextstyle(8, 0, 2);
outtextxy(l + 5, t + 5,
"* +");
}
else if (i == 11) {
settextstyle(8, 0, 2);
outtextxy(l + 5, t + 5,
"0 _");
}
else if (i == 12) {
settextstyle(8, 0, 2);
outtextxy(l + 5, t + 5,
"# x");
}
i++;
l = l + 100;
}
t = t + 50;
l = 820;
}
}
void others()
{
setfillstyle(SOLID_FILL,
WHITE);
// Implement Microphone
circle(900, 710, 5);
floodfill(902, 712, 15);
// Implement Selfie Camera
circle(1030, 115, 8);
circle(1030, 115, 4);
floodfill(1031, 116, 15);
// Implement Speaker
rectangle(900, 110, 1000, 120);
setfillstyle(XHATCH_FILL, WHITE);
floodfill(905, 115, 15);
// Implement Mobile Brand Name
settextstyle(8, 0, 3);
outtextxy(895, 375, "SOUNETRA");
// Division Between
// Screen and Keys
line(800, 400, 1100, 400);
}
void menu_key()
{
setfillstyle(SOLID_FILL, WHITE);
// Menu Key
rectangle(930, 420, 980, 470);
rectangle(920, 410, 990, 480);
settextstyle(10, 0, 3);
outtextxy(940, 430, "OK");
floodfill(925, 415, 15);
// Left Upper Bottom
rectangle(820, 410, 890, 440);
rectangle(830, 420, 880, 430);
floodfill(835, 425, 15);
// Right Upper Bottom
rectangle(1020, 410, 1090, 440);
rectangle(1030, 420, 1080, 430);
floodfill(1035, 425, 15);
// Left Lower Bottom
rectangle(820, 450, 890, 480);
setfillstyle(SOLID_FILL, GREEN);
floodfill(825, 455, 15);
// Right Lower Bottom
rectangle(1020, 450, 1090, 480);
setfillstyle(SOLID_FILL, RED);
floodfill(1025, 455, 15);
}