PROGRAM TO IMPLEMENT BINARY SEARCH
/*PROGRAM TO IMPLEMENT BINARY SEARCH*/ #include<conio.h> #include<iostream.h> class binry_srch { int n,low,high,mid,srch,i,a[10]; public: void input(); void result(); …
/*PROGRAM TO IMPLEMENT BINARY SEARCH*/ #include<conio.h> #include<iostream.h> class binry_srch { int n,low,high,mid,srch,i,a[10]; public: void input(); void result(); …
/*PROGRAM TO COMPARE TWO STRINGS BY TAKING STRING COMPARISON FUNCTION AS PRIVATE FUNCTION*/ #include<conio.h> #include<iostream.h> #include<stdio.h> class str_comparison { int i,count1,count2; char a[10],b[10]; void output(); public: void input(); }; void …
/*PROGRAM TO SHOW COUNT HOW MANY INSTANCES OF CLASS OBJECT ARE CREATED USING CONCEPT OF STATIC MEMBER FUNCTIONS*/ #include<conio.h> #include<iostream.h> class stat_fun { static int count; //STATIC DATA DECLARATION public: …
/*PROGRAM TO SHOW THE CONCEPT OF STATIC DATA*/ #include<conio.h> #include<iostream.h> class stat_data { int i,sum; static int counter; //STATIC DATA DECLARATION public: void process(); }; void stat_data::process() { cout<<“Numbers upto …
/*PROGRAM TO SHOW THE CONCEPT OF NESTING OF MEMBER FUNCTIONS*/ #include<conio.h> #include<iostream.h> class nest_fun { int l,b,area; public: void input(); void output(int,int); }; void nest_fun::input() { cout<<“Enter length and breadth …
/*PROGRAM TO IMPLEMENT DEFAULT ARGUMENTS*/ #include<conio.h> #include<iostream.h> class deflt_arg { int a,b; public: void input(); void process(int a=2,int b=3,int c=5,int d=6); }; void deflt_arg::input() { cout<<“Enter any two numbers: “; …
/*PROGRAM TO SHOW CONCEPT OF ARRAY AND UNION*/ #include<conio.h> #include<iostream.h> #include<stdio.h> class struct_union { int i; struct { char n[10]; int roll_no; }s; union { char n[10]; int roll_no; }u; …
/*PROGRAM TO SHOW NESTED STRUCTURES*/ #include<conio.h> #include<iostream.h> #include<stdio.h> class nest_struct { struct dob { int day,year,month; }; struct student { char name[10]; int roll_no; dob d1; }s1; public: void input(); …
/*PROGRAM TO SHOW ARRAY OF OBJECTS*/ #include<conio.h> #include<iostream.h> #include<stdio.h> class arr_object { char name[10]; public: void input(int); void output(int); }; void arr_object::input(int i) { cout<<“Enter “<<i+1<<” name: “; gets(name); } …
/*PROGRAM TO SHOW ARRAY INSIDE STRUCTURES*/ #include<conio.h> #include<iostream.h> #include<stdio.h> class arr_struct { int i; struct { char n[10]; int roll_no,total; int marks[5]; }s; public: void input(); void output(); }; void …