Sie sind auf Seite 1von 17

SOURCE CODE

#include<iostream.h>

#include<conio.h>

#include<iomanip.h>

int table(void);

int year(void);

float greatest(void);

int welcome(void);

float calc(void);

int evenodd(void);

void main()

welcome();

int welcome(void)

clrscr();

int choice1;

clrscr();
cout<<setw(60)<<"* * * * WELCOME * * * *\n\n\n\n\n\n\n";

cout<<setw(40)<<"THE MENU IS :->\n\n\n";

cout<<setw(40)<<"1.CALCULATOR.\n\n";

cout<<setw(58)<<"2.TO CHECK FOR EVEN OR ODD NO. \n\n";

cout<<setw(71)<<"3.TO CHECK FOR GREATEST AMONG THE TWO

NO.'s.\n\n";

cout<<setw(66)<<"4.TO FORM A TABLE OF THE ENTERED

NO.'s.\n\n";

cout<<setw(58)<<"5.TO FIND A YEAR A LEAP OR NOT.\n\n";

cout<<setw(37)<<"6.TO EXIT.\n\n";

cout<<setw(43)<<"ENTER UR CHOICE ::-->";

cin>>choice1;

switch(choice1)

case 1:calc();

break;

case 2:evenodd();

break;

case 3:greatest();

break;
case 4:table();

break;

case 5:year();

break;

return 0;

int year(void)

clrscr();

int g;

cout<<"ENTER THE YEAR TO BE TESTED FOR LEAP YEAR OR NOT

:-> ";

cin>>g;

if(g%4==0)

cout<<"\n\n\nTHE YEAR "<<g<<" IS LEAP YEAR ";

else

cout<<"\n\n\nTHE YEAR "<<g<<" IS NOT A LEAP YEAR ";

getch();
welcome();

return 0;

int table(void)

clrscr();

int f,limit;

cout<<"ENTER THE NO FOR U WANT THE TABLE TO BE

DISPLAYED(integer only) :--> ";

cin>>f;

cout<<"\n\n\nENTER THE LIMIT OF THE TABLE(integer only) :-> ";

cin>>limit;

cout<<"\n\n\n";

for(int i=1;i<=limit;i++)

cout<<" "<<f<<" *"<<" "<<i<<" = "<<f*i<<endl<<endl;

getch();

welcome();
return 0;

float greatest(void)

clrscr();

float c,d;

cout<<"\n\n\nENTER THE NO.'S TO TEST FOR GREASTEST AMONG

THE TWO NO.'s :->\n\n";

cin>>c>>d;

if(c>d)

cout<<"\n\n\n"<<c<<" IS GREATER THEN "<<d;

if(d>c)

cout<<"\n\n\n"<<d<<" IS GREATER THEN "<<c;

if(c==d)

cout<<"\n\n\nBOTH THE NO.'S ARE EQUAL ";

getch();

welcome();

return 0;

}
int evenodd(void)

clrscr();

int a;

cout<<"\n\nENTER THE INTEGER TYPE ONLY NO TO CHECK FOR

EVEN OR ODD :->";

cin>>a;

if(a%2==0)

cout<<"\n\n\nTHE NO. "<<a<<" EVEN NO.";

else

cout<<"\n\n\nTHE NO. "<<a<<" ODD NO.";

getch();

welcome();

return 0;

float calc(void)

clrscr();
float a,b;

int choice;

cout<<"\n\n * * * * * * * * * * * * * * CALCULATOR *****

* * * * * * "<<endl;

cout<<"\n\n1. ADD ."<<endl;

cout<<"\n\n2. SUBTRACT ."<<endl;

cout<<"\n\n3. MULTIPLY ."<<endl;

cout<<"\n\n4. DIVIDE ."<<endl;

cout<<"\n\nENTER UR CHOICE:->\n \n";

cin>>choice;

cout<<"\n\nENTER TWO NO'S\n\n";

cin>>a>>b;

switch(choice)

case 1:cout<<"\n\nTHE SUM OF TWO NO'S IS :->"<<a+b;

break;

case 2:cout<<"\n\nTHE DIFFRENCE OF TWO NO'S IS :->"<<a-b;

break;

case 3:cout<<"\n\nTHE MULTIPLICATION OF TWO NO'S IS

:->"<<a*b;
break;

case 4:cout<<"\n\nTHE DIVISION OF TWO NO'S IS :->"<<a/b;

break;

getch();

welcome();

return 0;

}
Acknowledgement

It is a matter of pleasure of

acknowledgement my

indebtedness to my Computer

Teacher ,

…………………………………. for his

great and needy help in the

completion of this project. I

express my thanks and

gratitude to him. He helped me

and provided valuable


guidance at each and every

step.

I also thanks to Principal,

…………………………, Jammu for

her deep interest, valuable

Guidance, encouragement and

the facilities provided to me

during the course.

Working Environment
Working Environment

1.1 Hardware Environment

System With following configuration :

 Processor: Pentium-4

 RAM : 256 MB

 Hard Disk: 80 GB

 FDD 1.44 MB

 C-Drive : DVD Multi Recorder

 Monitor : 15”

1.2 Software Environment:

Servers:

 Web Server : IIS, Personal Web Server (PWS)

 Operating System: Windows XP

 Language : C++

CERTIFICATE
This is to certify that this

Project Report of Computer

Science to class Roll No: ______ OF

Higher Secondary Part-II (12th

Class) Exam Roll No. ______________

of the Annual Session 2013-2014.

This student has completed the

required Project and all

signatures are genuine to the best

of my knowledge.

Lecturer/Teacher
Principal

Das könnte Ihnen auch gefallen