
































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!

































#include #include class operation { private: int a,b; public: voidread() { cout<<"Enter TwoNumbers :"; cin>>a>>b; } voidshow() { cout<<"You Enter\na = "< cout<<"\nCannotDivideBy Zero "; } voidmodulus( ) { int r=a%b; cout<<"\nModulus of given number is : "<
#include #include class sum { private: int a,b,r1,r2; public: voidinput(); void add(sum,sum); voidoutput(); }; void sum::input() { cout<<"Enter value of a Andb :"; cin>>a>>b; } void sum::add(sum ss1,sum ss2) { r1=ss1.a+ss2.a; r2=ss1.b+ss2.b; } void sum::output() { cout<<"value on Addition :"; cout<
#include #include struct student { int roll_no; char name[20]; float per; }; void main() { clrscr(); student s1; cout<<"Enter Student Details :>\ n"; cout<<"Enter RollNo :"; cin>>s1.roll_no; cout<<"EnterName :"; cin.ignore(); cin.get(s1.name,20); cout<<"EnterPercentage :"; cin>>s1.per; cout<<"\nDetailsof Student are :>"; cout<<"\nRollNo : "<
#include #include struct date { int day; int month; int year; }; struct employee { int emp_id; char name[20]; char dept_name[20]; double salary; date doj; }; void main() { clrscr(); employee e1; cout<<"Enter Employee Details :>\ n"; cout<<"Enter EmployeeID :"; cin>>e1.emp_id; cout<<"Enter EmployeeName :"; cin.ignore(); cin.get(e1.name,20); cout<<"Enter DepartmentName :"; cin.ignore(); cin.get(e1.dept_name,20); cout<<"EnterSalary :"; cin>>e1.salary; cout<<"Enter Date OfJoining :"; cin>>e1.doj.day>>e1.doj.month>>e1.doj.year; cout<<"DEtailsof Employeeare :\ n"; cout<<"\nID : "< cout<<"\nDate of Joining : "<
#include #include class rectangle { private: int length,breadth; public: rectangle() { length=10; breadth=20; } int area() { return(length*breadth); } }; void main() { clrscr(); rectangle r1; int ar=r1.area(); cout<<"Area ofrectangle is: "<
#include #include class rectangle { private: int length,breadth; public: rectangle(int l,intb) { length=l; breadth=b; } int area() { return(length*breadth); } }; void main() { clrscr(); rectangle r1(10,20); rectangle r2(5,6); cout<<"Area of Rectangle r1is : "<
#include #include class counter { private: int id; public: counter(int i) { id=i; cout<<"\nObjectwithID :"<
void result::call() { int marks=0; for(int i=0;i<4;i++) { marks=marks+m[i]; } total_marks=marks; per=total_marks/ 4; } void result::output() { show(); cout<<"\nTotalMarks = "<
#include #include class publication { private: char publisher[20]; protected: double price; public: voidread() { cout<<"\nEnterPublisher andPrice :"; cin>>publisher>>price; } voidshow() { cout<<"\nPublisher: "<>pub_sales; } voidshow() { cout<<"\nTotalsales of Publication :"<