M

@Mohan

Multiply Two Different Data Using Function Template

C++
5 years ago
#include <iostream> using namespace std; template <class T1, class T2> void display(T1 a,T2 b) { cout<<"\n\n Integer("<<a<<") * Float("<<b<<") = "<<a*b; } int main() { int x;

Sorting an Array of Elements

C++
5 years ago
#include<iostream> using namespace std; int main() { int ele[20],temp,i,j; int no_of_ele; cout<<"\n --------------------------------"; cout<<"\n Sorting. "; cout<<"\n -------------------------------

Palindrome

C++
5 years ago
#include <iostream> using namespace std; class palindrome { int temp, x, rev; public: int num; void getdata(); void process();

Implementing Virtual base class

C++
5 years ago
#include<iostream> using namespace std; class student { char name[5],clas[10]; int rn; public: void getdata() { cout<<"\n Enter the student name:";

Hospital Management using Hybrid Inheritance

C++
5 years ago
#include<iostream> using namespace std; class hosp { protected: char hn[20],to[20],dn[20]; public: void get() { cout<<"\n Hospital's Details";

Library Management using Multilevel Inheritance

C++
5 years ago
#include<iostream> using namespace std; class libo { protected: int n,m[10],rn; char aut[20][10],bak[20][10],rd[20][10],td[20][10],name[10]; public: void getbook() {

Arithmetic Operations using Single Inheritance

C++
5 years ago
#include<iostream> using namespace std; class arithmetic { int a,b,c; public: void getdata(); int add(); int sub(); int mul();

Example

C++
5 years ago
#include <iostream> using namespace std; class Room { private: double length; double breadth; double height;

Single Inheritance

C++
5 years ago
#include <iostream> using namespace std; class base { public: void dis() { cout<<"Inherited by Derived class"<<endl; } };

Ex_Template

C++
5 years ago
#include <iostream> using namespace std; template <class T> void putdata(T a,T b) { cout<<"\n (Template) "<<a<<" * "<<b<<" = "<<a*b; } void putdata(int a,int b) { cout<<"\n (Explicit) "<<a<<" * "<<b<<" = "<<a*b;

Template Swap

C++
5 years ago
#include <iostream> using namespace std; template <class T> T swap(T&a,T&b) { T temp; temp=a; a=b; b=temp; }

Ex (Template)

C++
5 years ago
#include <iostream> using namespace std; template <class T> class base { T a; public: base (T b) { a=b;

Sorting

C++
5 years ago
#include <iostream> using namespace std; class sort { public: int a[10],i,j,temp=0,n; void getdata() { cout<<"\n How many values you want to sort : "; cin>>n;

Ex (Virtual Function)

C++
5 years ago
#include <iostream> using namespace std; class base { public: virtual void dis() { cout<<" Base Class"; } };

Ex (Pointer)

C++
5 years ago
#include <iostream> using namespace std; int main() { int value=8,*ptr; ptr=&value; cout<<"\n The address of value : "<<ptr; cout<<"\n The value is : "<<value; *ptr=(*ptr)/2; cout<<"\n The value is (after deviding 2) : "<<*pt

Matrix Multiplication

C++
5 years ago
#include <iostream> using namespace std; class matrix { int a[10][10],b[10][10],mul[10][10]; int r1,r2,c1,c2; int i,j,k; public: void getrandc() {

Working Ex(Virtual)

C++
5 years ago
#include <iostream> using namespace std; class details { public: char name[30],cls[20]; int roll_no,mark[5],tot=0; float avg; void get1() {

Working Ex(Virtual)

C++
5 years ago
#include <iostream> using namespace std; class base { public: char name[30],cls[20]; int roll_no,mark[5]; void get1() { cout<<"\n Enter the Student Name : ";

Ex(Virtual)

C++
5 years ago
#include <iostream> using namespace std; class base { public: int x; }; class derived1:virtual public base { public:

Add & Sub Matrix

C++
5 years ago
#include <iostream> using namespace std; class matrix { int i,j,row,column; int first[10][10],second[10][10],add[10][10],sub[10][10]; public: void randc() { cout<<"\n Enter the Row and Column size for the Matrixes : ";