SlideShare a Scribd company logo
1 of 35
SHRI RAWATPURA SARKAR INSTITUTE OF TECHNOLOGY-II, NEW RAIPUR
CSE/4th
/CN Lab/PreparedbyVivekKumarSinha
SHRI RAWATPURA SARKAR INSTITUTE OF TECHNOLOGY-II NEW RAIPUR
Department of ComputerScience and engineering
LAB MANUAL
For
Object Oriented Programming Language (C++)
SHRI RAWATPURA SARKAR INSTITUTE OF TECHNOLOGY-II, NEW RAIPUR
CSE/4th
/CN Lab/PreparedbyVivekKumarSinha
Experiment No. 1
Aim: Write a program to check whether number is prime or not.
Source:
#include<iostream.h>
#include<conio.h>
using namespace std;
int main()
{
int num,count=0;
cout<<”Enter the number number to check:”;
cin>>num;
for(int i=2;i<num;i++)
{
if(num%i==0)
{
Count++;
break;
}
}
if(count==0)
cout<<”it is a prime number”;
else
SHRI RAWATPURA SARKAR INSTITUTE OF TECHNOLOGY-II, NEW RAIPUR
CSE/4th
/CN Lab/PreparedbyVivekKumarSinha
cout<<”It is not prime number”;
getche();
}
********************output******************************
Enter the number to check: 97
It is a prime number
Enter the number to check: 8
It is not a prime number
_____________________________________________________________
____
SHRI RAWATPURA SARKAR INSTITUTE OF TECHNOLOGY-II, NEW RAIPUR
CSE/4th
/CN Lab/PreparedbyVivekKumarSinha
Experiment 2
Aim:Writea program to read numberand to displaythe largest valuebetween
two numbers.
Source:
#include<iostream.h>
#include<conio.h>
using namespace std;
Class largest
{
Int d;
Public: void getdata();
Void display_large(largest,largest);
};
Void largest:: getdata()
{
cout<<”nnEnter value:”;
cin>>d;
}
Void largest::display_largest(largest o1,largest o2)
{
If(o1.d>o2.d)
cout<<”n object I contain largest value”;
else if (o1.d<o2.d)
cout<<”n object 2 contains largest value”;
else
cout<<”Bothare equals”;
}
SHRI RAWATPURA SARKAR INSTITUTE OF TECHNOLOGY-II, NEW RAIPUR
CSE/4th
/CN Lab/PreparedbyVivekKumarSinha
void main()
{
largest o1,o2,o3;
clrscr();
01.getdata();
02.getdata();
03.display_largest(o1,o2);
getche();
}
****************************OUTOUT*************************
***************
Enter value: 12
Enter value: 22
Object 2 contains the largest value.
_____________________________________________________________
____
SHRI RAWATPURA SARKAR INSTITUTE OF TECHNOLOGY-II, NEW RAIPUR
CSE/4th
/CN Lab/PreparedbyVivekKumarSinha
Experiment 3
Aim:Writea program to find sum of the first natural numbers:
1+2+3+………100byusing
(a) For loop
(b) While Loop
(c) DO….whileLoop
Source:
#include<iostream.h>
#include<conio.h>
using namespace std;
int main()
{
int ch,sum=0;
cout<<”Sumof first 100 natural numbers”;
cout<<”n 1. Using for loop”;
cout<<”n 2. Using while loop”;
cout<<”n 3. Using do….while loop”;
cout<<”Enter your choice:”;
cin>>ch;
switch(ch)
{
case 1: for(int num=1;num<=100;num++)
sum=num+sum;
SHRI RAWATPURA SARKAR INSTITUTE OF TECHNOLOGY-II, NEW RAIPUR
CSE/4th
/CN Lab/PreparedbyVivekKumarSinha
cout<<”nn The sum of first 100 naturals number is”;
cin>>sum;
break;
case 2: while(num=100);
{
sum=num+sum;
num++;
}
cout<<”nn The sum of first 100 naturals number is”;
cin>>sum;
break;
case 3: do
{
sum=num+sum;
num++;
} while(num=100);
cout<<”nn The sum of first 100 naturals number is”;
cin>>sum;
break;
default: cout<<”please enter the valid choice”;
}
getche();
SHRI RAWATPURA SARKAR INSTITUTE OF TECHNOLOGY-II, NEW RAIPUR
CSE/4th
/CN Lab/PreparedbyVivekKumarSinha
}
******************************OUTPUT*****************************************
****
Sum of first 100 natural numbers
1. Using for loop
2. Using while loop
3. Using do….while loop
Enter youe choice: 1
The sum of first natural number is :5050
______________________________________________________________________________
_____
SHRI RAWATPURA SARKAR INSTITUTE OF TECHNOLOGY-II, NEW RAIPUR
CSE/4th
/CN Lab/PreparedbyVivekKumarSinha
Experiment 4
Aim:Writea program to find sum of the following series using function
declaration.
Sum=
Source:
#inlude<iostream.h>
#include<conio.h>
Using namespace std;
Void main()
{
long int fact(int); // function declaration……………………………
float power (float, int);
float sum,temp,x,pow;
int sign,I,n;
long int factval;
cout<<”Enter a value of n?”;
cin>>n;
cout<<”Enter the value of X?”;
cin>>x;
i=3;
sum=x;
sign=1;
while(i<=n)
SHRI RAWATPURA SARKAR INSTITUTE OF TECHNOLOGY-II, NEW RAIPUR
CSE/4th
/CN Lab/PreparedbyVivekKumarSinha
{
factval=fact(i);
pow=power(x,i);
sign=(-1)*sign;
temp=sign*pow/factval;
sum=sum+temp;
i=i+2;
}
Cout<<”sumog the series is :”;
getche();
}
// end of the main function………………………………….
long int fact( int max)
{
long int value;
value=1;
for(int i=1;i<=max;++i)
value=value*I;
return(value);
}
float power(float x, int n)
{
float value2;
value2=1;
for(int j=1;j<=n;++j)
value2=value2*x;
return ( value2);
SHRI RAWATPURA SARKAR INSTITUTE OF TECHNOLOGY-II, NEW RAIPUR
CSE/4th
/CN Lab/PreparedbyVivekKumarSinha
}
***************************OUTPUT**************************
*****
Enter a value for n?
7
Enter a value for x?
1
Sumof the series is: 0.841468
SHRI RAWATPURA SARKAR INSTITUTE OF TECHNOLOGY-II, NEW RAIPUR
CSE/4th
/CN Lab/PreparedbyVivekKumarSinha
Experiment 5
Aim:Writea program to read the elementsof the given twomatricesof
order n*n and to perform the matrix multiplication.
Source:
#inlude<iostream.h>
#include<conio.h>
#define MAX 100
Using namespace std;
Void main()
{
void output(float a[max] [max], int n);
void mul(float a[max][ max], float b[max][ max],int n);
float a[max][max],b[max][max];
Int I,j,n;
cout<<”orderofmatrix A “<<endl;
cin>>n;
cout<<”enter the elements for the matrix A:”<<endl;
for(i=0;i<=n-1;++i)
{
for(j=0;j<=n-1;++j)
cin>>a[i][j];
}
cout<<”orderof matrix B “<<endl;
cin>>n;
cout<<”enter the elements for the matrix B:”<<endl;
for(i=0;i<=n-1;++i)
{
for(j=0;j<=n-1;++j)
cin>>b[i][j];
}
cout<<”outputA[i][j] “<<endl;
output(a,n);
SHRI RAWATPURA SARKAR INSTITUTE OF TECHNOLOGY-II, NEW RAIPUR
CSE/4th
/CN Lab/PreparedbyVivekKumarSinha
cout<<”outputB[i][j] “<<endl;
output(b,n);
mul(a,b,n);
getche();
} // end of the main function…………………………….
// function definition………………………………………
void mul(float a[max][ max], float b[max][ max],int n)
{
void output(float c[max][ max],int n);
float c[max][ max];
int I,j,k;
for(i=0;i<=n-1;++i)
{
for(j=0;j<=n-1;++j)
{
c[i][j]=0.0;
for(k=0;k<=n-1;++k)
c[i][j]=c[i][j]+a[i][j]*b[k][j];
}
cout<<endl;
cout<<”Outputof c[i][j] matrix”<<endl;
output(c,n);
}
void output(float x[max][max],int n)
{
int I,j;
for (i=0; i<=n-1;++i)
{
for(j=0;j<=n-1;++j)
cout<<x[i][j]<<’t’;
cout<<endl;
}
}
SHRI RAWATPURA SARKAR INSTITUTE OF TECHNOLOGY-II, NEW RAIPUR
CSE/4th
/CN Lab/PreparedbyVivekKumarSinha
****************************OUTPUT*************************
*****
Order of matrix A
3
Enter the elements of matrix A:
3 3 3
3 3 3
3 3 3
Order of matrix B
3
Enter the elements of matrix B:
3 3 3
3 3 3
3 3 3
Output A[i][j]
3 3 3
3 3 3
3 3 3
Output B[i][j]
3 3 3
3 3 3
3 3 3
Output of C[i][j] matrix
27 27 27
27 27 27
27 27 27
SHRI RAWATPURA SARKAR INSTITUTE OF TECHNOLOGY-II, NEW RAIPUR
CSE/4th
/CN Lab/PreparedbyVivekKumarSinha
Experiment 6
Aim:Writea program to exchangethe contents of twovariablesby using
(a) call by value(b) call by reference.
Source:
(a)
// Call by value ………………
#inlude<iostream.h>
#include<conio.h>
Using namespace std;
Void main()
{
int x,y;
void swap(int,int);
x=100;
y=20;
cout<<”values before swap ()”<<endl;
cout<<”x = ”<< x <<”and y = ”<<y<<endl;
swap(x,y);
cout<<”values after swap swap ()”<<endl;
cout<<”x = ”<< x <<”and y = ”<<y<<endl;
getche();
}
// end of the main function………………………………
SHRI RAWATPURA SARKAR INSTITUTE OF TECHNOLOGY-II, NEW RAIPUR
CSE/4th
/CN Lab/PreparedbyVivekKumarSinha
Void swap(int x,int y) // values will not be
swapped……………………..
{
Int temp;
Temp=x;
X=y;
Y=temp;
}
*************************output**************************
**********
Values before swap ()
X=100 and y==20
Values after swap ()
X=100 and y==20
(b) call by reference…………………………………
#inlude<iostream.h>
#include<conio.h>
Using namespace std;
Void main()
{
int x,y;
void swap(int *x,int *y);
x=100;
y=20;
cout<<”values before swap ()”<<endl;
cout<<”x = ”<< x <<”and y = ”<<y<<endl;
SHRI RAWATPURA SARKAR INSTITUTE OF TECHNOLOGY-II, NEW RAIPUR
CSE/4th
/CN Lab/PreparedbyVivekKumarSinha
swap(x,y);
cout<<”values after swap swap ()”<<endl;
cout<<”x = ”<< x <<”and y = ”<<y<<endl;
getche();
} // end of the main function………………………………
Void swap(int *x, int * y) // values will be
swapped……………………..
{
int temp;
temp=*x;
*x=*y;
*y=temp;
}
*************************output**************************
**********
Values before swap ()
X=100 and y==20
Values after swap ()
X=20 and y==100
SHRI RAWATPURA SARKAR INSTITUTE OF TECHNOLOGY-II, NEW RAIPUR
CSE/4th
/CN Lab/PreparedbyVivekKumarSinha
Experiment 7
Aim:Writea program to perform the following operationsof a complex
numberusinga structure.
1. Addition of two complex numbers
2. Subtraction of two complex numbers
3. Multiplication of twocomplex numbers
4. Division of two complex numbers
Source:
Struct complex {
float real;
float imag;
};
complex add (complex a,complex b);
complex sub (complex a,complex b);
complex mul (complex a,complex b);
complex div (complex a,complex b);
#inlude<iostream.h>
#include<conio.h>
using namespace std;
void main()
{
complex a,b,c;
int ch;
void menu(void);
cout<<”Enter the first complex number n”;
cin>>a.real>>a.imag;
cout<<”Enter the second complex number n”;
SHRI RAWATPURA SARKAR INSTITUTE OF TECHNOLOGY-II, NEW RAIPUR
CSE/4th
/CN Lab/PreparedbyVivekKumarSinha
cin>>b.real>>b.imag;
menu();
while((ch = getchar()) !=’q’)
{
switch (ch)
{
case ‘a’:
c = add (a,b);
cout<<”Addition of two complex number n”;
cout<<c.real<<”+ i”<< c.imag << endl;
` break;
case ‘s’:
c = sub (a,b);
cout<<”Substractionof two complex number n”;
cout<<c.real<<”+ i”<< c.imag << endl;
` break;
case ‘m’:
c = mul (a,b);
cout<<”Multiplication of two complex number
n”;
cout<<c.real<<”+ i”<< c.imag << endl;
` break;
case ‘d’:
c = div (a,b);
cout<<”Division of two complex number n”;
cout<<c.real<<”+ i”<< c.imag << endl;
` break;
}
}
} // ……………..End ofthe main
function……………………………
void menu ()
SHRI RAWATPURA SARKAR INSTITUTE OF TECHNOLOGY-II, NEW RAIPUR
CSE/4th
/CN Lab/PreparedbyVivekKumarSinha
{
cout<< “complex number operations nn”;
cout<<”menu()”;
cout<<”a -> Addition n”;
cout<<”s -> Substraction n”;
cout<<”m -> Multiplication n”;
cout<<”d -> Division n”;
cout<<”q -> Quit n ”;
cout<<” option please…………… n ”;
}
complex add (struct complex a, struct complex b)
{
complex c;
c.real=a.real+b.real;
c.imag=a.imag+b.imag;
return(c);
}
complex sub (struct complex a, struct complex b)
{
complex c;
c.real=a.real - b.real;
c.imag=a.imag + b.imag;
return(c);
}
complex mul (struct complex a, struct complex b)
{
complex c;
c.real=(a.real * b.real) – (a.imag * b.imag);
c.imag=(a.real * b.real) + (a.imag * b.imag);
return(c);
}
complex div (struct complex a, struct complex b)
{
SHRI RAWATPURA SARKAR INSTITUTE OF TECHNOLOGY-II, NEW RAIPUR
CSE/4th
/CN Lab/PreparedbyVivekKumarSinha
complex c;
float temp;
temp = (b.real*b.real) + (b.imag*b.imag);
c.real=((a.real * b.real) + (a.imag * b.imag))/temp;
c.imag=((a.real * b.real) - (a.imag * b.imag))/temp;
return(c);
}
***********************OUTPUT*************************
**********
Enter the first complex number
1 1
Enter the second number
2 2
Complex number operations
Menu()
a -> Addition
s -> Substraction
m -> Multiplication
d -> Divison
q -> Quit or Exit?
Option, please ?
a
Additon of two complex numbers
3 + i3
s
Substraction of two complex numbers
-1i-1
m
Multiplication of two complex numbers
0i4
d
Division of two complex numbers
0.5i0
SHRI RAWATPURA SARKAR INSTITUTE OF TECHNOLOGY-II, NEW RAIPUR
CSE/4th
/CN Lab/PreparedbyVivekKumarSinha
q
Experiment 8
Aim:Writea program to perform the swapping of twodata itemsof integers,
floating pointnumberand character type withthe help of function overloading.
Source:
#inlude<iostream.h>
#include<conio.h>
using namespace std;
void swap (int &ix, int &iy);
void swap (float &ix, float &iy);
void swap (char &ix, char &iy);
void main()
{
int ix,iy;
float fx, fy;
char cx,cy;
cout<<”enter the two integers n”<<endl;
cin>> ix>>iy;
cout<<”enter the two floating point numbers n”<<endl;
cin>> fx>>fy;
cout<<”enter the two characters n”<<endl;
SHRI RAWATPURA SARKAR INSTITUTE OF TECHNOLOGY-II, NEW RAIPUR
CSE/4th
/CN Lab/PreparedbyVivekKumarSinha
cin>> cx>>cy;
cout<<”swappingof integers n”;
cout<<”ix = ” <<ix<< “iy = ”<<iy<<endl;
swap(ix,iy);
cout<<”After swapping ”<<endl;
cout<<”ix = ” <<ix<< “iy = ”<<iy<<endl;
cout<<endl;
cout<<”swapping of floating point numbers n”;
cout<<”fx = ” <<fx<< “fy = ”<<fy<<endl;
swap(fx,fy);
cout<<”After swapping ”<<endl;
cout<<”fx = ” <<fx<< “fy = ”<<fy<<endl;
cout<<endl;
cout<<”swapping of characters n”;
cout<<”cx= ” <<cx<< “cy= ”<<cy<<endl;
swap(cx,cy);
cout<<”After swapping ”<<endl;
cout<<”cx= ” <<cx<< “cy= ”<<cy<<endl;
cout<<endl;
} //……END OF THE main FUNCTION…………………………
void swap (int &a, int &b)
SHRI RAWATPURA SARKAR INSTITUTE OF TECHNOLOGY-II, NEW RAIPUR
CSE/4th
/CN Lab/PreparedbyVivekKumarSinha
{
int temp;
temp=a;
a=b;
b=temp;
}
void swap (float &a, float &b)
{
float temp;
temp=a;
a=b;
b=temp;
}
void swap (char &a, char &b)
{
char temp;
temp=a;
a=b;
b=temp;
}
***************************OUTPUT*********************
**********
SHRI RAWATPURA SARKAR INSTITUTE OF TECHNOLOGY-II, NEW RAIPUR
CSE/4th
/CN Lab/PreparedbyVivekKumarSinha
Enter any two integers
100 200
Enter any two floating point numbers
-11 22.22
Enter any two characters
s t
swapping of integers
ix = 100 iy = 200
After swapping
ix = 200 iy = 100
swapping of floating point numbers
fx = -11.11 fy = 22.219099
After swapping
fx = 22.219099 fy = -11.11
swapping of characters
cx = s cy = t
After swapping
cx = t cy = s
________________________________________________________
SHRI RAWATPURA SARKAR INSTITUTE OF TECHNOLOGY-II, NEW RAIPUR
CSE/4th
/CN Lab/PreparedbyVivekKumarSinha
Experiment 9
Aim: Write a C++ program to to generate a fibonacciseries by
overloading:
(a)Prefix overloading (b) postfix overloading
Source:
(a)
#inlude<iostream.h>
#include<conio.h>
using namespace std;
class fibonnaci
{
private:
unsigned long int f0,f1,fib;
public:
fibonacci();
void operater++();
void display ();
};
fibonacci :: fibonacci()
{
fo=0;
SHRI RAWATPURA SARKAR INSTITUTE OF TECHNOLOGY-II, NEW RAIPUR
CSE/4th
/CN Lab/PreparedbyVivekKumarSinha
f1=1;
fib=f0+f1;
}
void fibonacci :: display ()
{
cout<<fib<<’t’;
}
voiod fibonacci :: operator++( )
{
fo=f1;
f1=fib;
fib=f0+f1;
}
void main()
{
fibonacci obj;
int n;
cout<< “How many fibonacci numbers are to be ”;
cout<<”Displayed ? n”:
cin>>n;
for(int i=0; i<=n=1;++i)
SHRI RAWATPURA SARKAR INSTITUTE OF TECHNOLOGY-II, NEW RAIPUR
CSE/4th
/CN Lab/PreparedbyVivekKumarSinha
{ obj.display();
++obj;
}
} ……………………..ENDof the main function
………………………………….
(b)
#inlude<iostream.h>
#include<conio.h>
using namespace std;
class fibonnaci
{
private:
unsigned long int f0,f1,fib;
public:
fibonacci(); //
………………..contructor………………………….
void operater++( int );
void display ();
};
fibonacci :: fibonacci()
{
SHRI RAWATPURA SARKAR INSTITUTE OF TECHNOLOGY-II, NEW RAIPUR
CSE/4th
/CN Lab/PreparedbyVivekKumarSinha
fo=0;
f1=1;
fib=f0+f1;
}
void fibonacci :: display ()
{
cout<<fib<<’t’;
}
fibonacci fibonacci :: operator++(int x)
{
fo=f1;
f1=fib;
fib=f0+f1;
return *this;
}
void main()
{
fibonacci obj;
int n;
cout<< “How many fibonacci numbers are to be ”;
cout<<”Displayed ? n”:
cin>>n;
SHRI RAWATPURA SARKAR INSTITUTE OF TECHNOLOGY-II, NEW RAIPUR
CSE/4th
/CN Lab/PreparedbyVivekKumarSinha
for(int i=0; i<=n=1;++i)
{ obj.display();
obj++; } } // …………………...End ofthe main()………………….
Experiment 10
Aim:Writea program to perform simplearithmeticoperationsof two
complex numbersusing operator overloading.
Source:
Struct complex {
float real;
float imag;
};
complex + (complex a,complex b);
complex - (complex a,complex b);
complex * (complex a,complex b);
complex / (complex a,complex b);
#inlude<iostream.h>
#include<conio.h>
using namespace std;
void main()
{
complex a,b,c;
int ch;
void menu(void);
cout<<”Enter the first complex number n”;
cin>>a.real>>a.imag;
cout<<”Enter the second complex number n”;
cin>>b.real>>b.imag;
SHRI RAWATPURA SARKAR INSTITUTE OF TECHNOLOGY-II, NEW RAIPUR
CSE/4th
/CN Lab/PreparedbyVivekKumarSinha
menu();
while((ch = getchar()) !=’q’)
{
switch (ch)
{
case ‘a’:
c = add (a,b);
cout<<”Addition of two complex number n”;
cout<<c.real<<”+ i”<< c.imag << endl;
` break;
case ‘s’:
c = sub (a,b);
cout<<”Substractionof two complex number n”;
cout<<c.real<<”+ i”<< c.imag << endl;
` break;
case ‘m’:
c = mul (a,b);
cout<<”Multiplication of two complex number
n”;
cout<<c.real<<”+ i”<< c.imag << endl;
` break;
case ‘d’:
c = div (a,b);
cout<<”Division of two complex number n”;
cout<<c.real<<”+ i”<< c.imag << endl;
` break;
}
}
} // ……………..End ofthe main
function……………………………
void menu ()
{
SHRI RAWATPURA SARKAR INSTITUTE OF TECHNOLOGY-II, NEW RAIPUR
CSE/4th
/CN Lab/PreparedbyVivekKumarSinha
cout<< “complex number operations nn”;
cout<<”menu()”;
cout<<”a -> Addition n”;
cout<<”s -> Substraction n”;
cout<<”m -> Multiplication n”;
cout<<”d -> Division n”;
cout<<”q -> Quit n ”;
cout<<” option please…………… n ”;
}
complex + (struct complex a, struct complex b)
{
complex c;
c.real=a.real+b.real;
c.imag=a.imag+b.imag;
return(c);
}
complex - (struct complex a, struct complex b)
{
complex c;
c.real=a.real - b.real;
c.imag=a.imag + b.imag;
return(c);
}
complex * (struct complex a, struct complex b)
{
complex c;
c.real=(a.real * b.real) – (a.imag * b.imag);
c.imag=(a.real * b.real) + (a.imag * b.imag);
return(c);
}
complex / (struct complex a, struct complex b)
{
complex c;
SHRI RAWATPURA SARKAR INSTITUTE OF TECHNOLOGY-II, NEW RAIPUR
CSE/4th
/CN Lab/PreparedbyVivekKumarSinha
float temp;
temp = (b.real*b.real) + (b.imag*b.imag);
c.real=((a.real * b.real) + (a.imag * b.imag))/temp;
c.imag=((a.real * b.real) - (a.imag * b.imag))/temp;
return(c);
}
***********************OUTPUT*************************
**********
Enter the first complex number
1 1
Enter the second number
2 2
Complex number operations
Menu()
a -> Addition
s -> Substraction
m -> Multiplication
d -> Divison
q -> Quit or Exit?
Option, please ?
a
Additon of two complex numbers
3 + i3
s
Substraction of two complex numbers
-1i-1
m
Multiplication of two complex numbers
0i4
d
Division of two complex numbers
0.5i0
SHRI RAWATPURA SARKAR INSTITUTE OF TECHNOLOGY-II, NEW RAIPUR
CSE/4th
/CN Lab/PreparedbyVivekKumarSinha
q
_______________________________________________________
SHRI RAWATPURA SARKAR INSTITUTE OF TECHNOLOGY-II, NEW RAIPUR
CSE/4th
/CN Lab/PreparedbyVivekKumarSinha

More Related Content

What's hot

Analysis of Haiku Operating System (BeOS Family) by PVS-Studio. Part 2
Analysis of Haiku Operating System (BeOS Family) by PVS-Studio. Part 2Analysis of Haiku Operating System (BeOS Family) by PVS-Studio. Part 2
Analysis of Haiku Operating System (BeOS Family) by PVS-Studio. Part 2PVS-Studio
 
VTU DSA Lab Manual
VTU DSA Lab ManualVTU DSA Lab Manual
VTU DSA Lab ManualAkhilaaReddy
 
How to not write a boring test in Golang
How to not write a boring test in GolangHow to not write a boring test in Golang
How to not write a boring test in GolangDan Tran
 
How to add an optimization for C# to RyuJIT
How to add an optimization for C# to RyuJITHow to add an optimization for C# to RyuJIT
How to add an optimization for C# to RyuJITEgor Bogatov
 
Data Structures Practical File
Data Structures Practical File Data Structures Practical File
Data Structures Practical File Harjinder Singh
 
The Ring programming language version 1.4 book - Part 21 of 30
The Ring programming language version 1.4 book - Part 21 of 30The Ring programming language version 1.4 book - Part 21 of 30
The Ring programming language version 1.4 book - Part 21 of 30Mahmoud Samir Fayed
 
Operator overloading2
Operator overloading2Operator overloading2
Operator overloading2zindadili
 
Programming with GUTs
Programming with GUTsProgramming with GUTs
Programming with GUTsKevlin Henney
 
Imugi: Compiler made with Python
Imugi: Compiler made with PythonImugi: Compiler made with Python
Imugi: Compiler made with PythonHan Lee
 
Story of static code analyzer development
Story of static code analyzer developmentStory of static code analyzer development
Story of static code analyzer developmentAndrey Karpov
 
Pads lab manual final
Pads lab manual finalPads lab manual final
Pads lab manual finalAhalyaR
 
Node.js System: The Landing
Node.js System: The LandingNode.js System: The Landing
Node.js System: The LandingHaci Murat Yaman
 
Basic Programs of C++
Basic Programs of C++Basic Programs of C++
Basic Programs of C++Bharat Kalia
 
High performance web programming with C++14
High performance web programming with C++14High performance web programming with C++14
High performance web programming with C++14Matthieu Garrigues
 
Aaron Bedra - Effective Software Security Teams
Aaron Bedra - Effective Software Security TeamsAaron Bedra - Effective Software Security Teams
Aaron Bedra - Effective Software Security Teamscentralohioissa
 
Egor Bogatov - .NET Core intrinsics and other micro-optimizations
Egor Bogatov - .NET Core intrinsics and other micro-optimizationsEgor Bogatov - .NET Core intrinsics and other micro-optimizations
Egor Bogatov - .NET Core intrinsics and other micro-optimizationsEgor Bogatov
 
DSU C&C++ Practical File Diploma
DSU C&C++ Practical File DiplomaDSU C&C++ Practical File Diploma
DSU C&C++ Practical File Diplomamustkeem khan
 

What's hot (20)

Analysis of Haiku Operating System (BeOS Family) by PVS-Studio. Part 2
Analysis of Haiku Operating System (BeOS Family) by PVS-Studio. Part 2Analysis of Haiku Operating System (BeOS Family) by PVS-Studio. Part 2
Analysis of Haiku Operating System (BeOS Family) by PVS-Studio. Part 2
 
VTU DSA Lab Manual
VTU DSA Lab ManualVTU DSA Lab Manual
VTU DSA Lab Manual
 
C programs
C programsC programs
C programs
 
How to not write a boring test in Golang
How to not write a boring test in GolangHow to not write a boring test in Golang
How to not write a boring test in Golang
 
How to add an optimization for C# to RyuJIT
How to add an optimization for C# to RyuJITHow to add an optimization for C# to RyuJIT
How to add an optimization for C# to RyuJIT
 
Data Structures Practical File
Data Structures Practical File Data Structures Practical File
Data Structures Practical File
 
C++ file
C++ fileC++ file
C++ file
 
The Ring programming language version 1.4 book - Part 21 of 30
The Ring programming language version 1.4 book - Part 21 of 30The Ring programming language version 1.4 book - Part 21 of 30
The Ring programming language version 1.4 book - Part 21 of 30
 
Operator overloading2
Operator overloading2Operator overloading2
Operator overloading2
 
Programming with GUTs
Programming with GUTsProgramming with GUTs
Programming with GUTs
 
Imugi: Compiler made with Python
Imugi: Compiler made with PythonImugi: Compiler made with Python
Imugi: Compiler made with Python
 
Story of static code analyzer development
Story of static code analyzer developmentStory of static code analyzer development
Story of static code analyzer development
 
Pads lab manual final
Pads lab manual finalPads lab manual final
Pads lab manual final
 
Node.js System: The Landing
Node.js System: The LandingNode.js System: The Landing
Node.js System: The Landing
 
Code optimization
Code optimization Code optimization
Code optimization
 
Basic Programs of C++
Basic Programs of C++Basic Programs of C++
Basic Programs of C++
 
High performance web programming with C++14
High performance web programming with C++14High performance web programming with C++14
High performance web programming with C++14
 
Aaron Bedra - Effective Software Security Teams
Aaron Bedra - Effective Software Security TeamsAaron Bedra - Effective Software Security Teams
Aaron Bedra - Effective Software Security Teams
 
Egor Bogatov - .NET Core intrinsics and other micro-optimizations
Egor Bogatov - .NET Core intrinsics and other micro-optimizationsEgor Bogatov - .NET Core intrinsics and other micro-optimizations
Egor Bogatov - .NET Core intrinsics and other micro-optimizations
 
DSU C&C++ Practical File Diploma
DSU C&C++ Practical File DiplomaDSU C&C++ Practical File Diploma
DSU C&C++ Practical File Diploma
 

Viewers also liked

Unit Testing on Android - Droidcon Berlin 2015
Unit Testing on Android - Droidcon Berlin 2015Unit Testing on Android - Droidcon Berlin 2015
Unit Testing on Android - Droidcon Berlin 2015Buşra Deniz, CSM
 
Computer applications in civil engineering lab
Computer applications in civil engineering labComputer applications in civil engineering lab
Computer applications in civil engineering labVivek Kumar Sinha
 
Company Profile - Compressed
Company Profile - CompressedCompany Profile - Compressed
Company Profile - CompressedSolly Moeng - APR
 
Computer hardware and simulation lab manual
Computer  hardware and simulation lab manualComputer  hardware and simulation lab manual
Computer hardware and simulation lab manualVivek Kumar Sinha
 
Softwareenggineering lab manual
Softwareenggineering lab manualSoftwareenggineering lab manual
Softwareenggineering lab manualVivek Kumar Sinha
 
Graphics User Interface Lab Manual
Graphics User Interface Lab ManualGraphics User Interface Lab Manual
Graphics User Interface Lab ManualVivek Kumar Sinha
 
Network security Lab manual
Network security Lab manual Network security Lab manual
Network security Lab manual Vivek Kumar Sinha
 
Eurest Breakfast White Paper
Eurest Breakfast White PaperEurest Breakfast White Paper
Eurest Breakfast White PaperGaurang Patel
 
Graphics practical lab manual
Graphics practical lab manualGraphics practical lab manual
Graphics practical lab manualVivek Kumar Sinha
 
COMPUTER GRAPHICS LAB MANUAL
COMPUTER GRAPHICS LAB MANUALCOMPUTER GRAPHICS LAB MANUAL
COMPUTER GRAPHICS LAB MANUALVivek Kumar Sinha
 
Lab manual of C++
Lab manual of C++Lab manual of C++
Lab manual of C++thesaqib
 

Viewers also liked (18)

Unit Testing on Android - Droidcon Berlin 2015
Unit Testing on Android - Droidcon Berlin 2015Unit Testing on Android - Droidcon Berlin 2015
Unit Testing on Android - Droidcon Berlin 2015
 
Teks ekposisi
Teks ekposisiTeks ekposisi
Teks ekposisi
 
Lab manual asp.net
Lab manual asp.netLab manual asp.net
Lab manual asp.net
 
Mech nacp lab
Mech nacp labMech nacp lab
Mech nacp lab
 
Computer applications in civil engineering lab
Computer applications in civil engineering labComputer applications in civil engineering lab
Computer applications in civil engineering lab
 
Cn lab manual
Cn lab manualCn lab manual
Cn lab manual
 
Company Profile - Compressed
Company Profile - CompressedCompany Profile - Compressed
Company Profile - Compressed
 
Computer hardware and simulation lab manual
Computer  hardware and simulation lab manualComputer  hardware and simulation lab manual
Computer hardware and simulation lab manual
 
Softwareenggineering lab manual
Softwareenggineering lab manualSoftwareenggineering lab manual
Softwareenggineering lab manual
 
Graphics User Interface Lab Manual
Graphics User Interface Lab ManualGraphics User Interface Lab Manual
Graphics User Interface Lab Manual
 
Java final lab
Java final labJava final lab
Java final lab
 
Network security Lab manual
Network security Lab manual Network security Lab manual
Network security Lab manual
 
Eurest Breakfast White Paper
Eurest Breakfast White PaperEurest Breakfast White Paper
Eurest Breakfast White Paper
 
WebRTC on Mobile
WebRTC on MobileWebRTC on Mobile
WebRTC on Mobile
 
Graphics practical lab manual
Graphics practical lab manualGraphics practical lab manual
Graphics practical lab manual
 
COMPUTER GRAPHICS LAB MANUAL
COMPUTER GRAPHICS LAB MANUALCOMPUTER GRAPHICS LAB MANUAL
COMPUTER GRAPHICS LAB MANUAL
 
Lab manual of C++
Lab manual of C++Lab manual of C++
Lab manual of C++
 
Ds lab handouts
Ds lab handoutsDs lab handouts
Ds lab handouts
 

Similar to Oops lab manual

Tugas praktikukm pemrograman c++
Tugas praktikukm  pemrograman c++Tugas praktikukm  pemrograman c++
Tugas praktikukm pemrograman c++Dendi Riadi
 
I have written the code but cannot complete the assignment please help.pdf
I have written the code but cannot complete the assignment please help.pdfI have written the code but cannot complete the assignment please help.pdf
I have written the code but cannot complete the assignment please help.pdfshreeaadithyaacellso
 
2 BytesC++ course_2014_c3_ function basics&parameters and overloading
2 BytesC++ course_2014_c3_ function basics&parameters and overloading2 BytesC++ course_2014_c3_ function basics&parameters and overloading
2 BytesC++ course_2014_c3_ function basics&parameters and overloadingkinan keshkeh
 
CBSE Class XI Programming in C++
CBSE Class XI Programming in C++CBSE Class XI Programming in C++
CBSE Class XI Programming in C++Pranav Ghildiyal
 
BPOPS203 PRINCIPLES OF PROGRAMMING USING C LAB Manual.pdf
BPOPS203 PRINCIPLES OF PROGRAMMING USING C LAB Manual.pdfBPOPS203 PRINCIPLES OF PROGRAMMING USING C LAB Manual.pdf
BPOPS203 PRINCIPLES OF PROGRAMMING USING C LAB Manual.pdfSyed Mustafa
 
C++ Nested loops, matrix and fuctions.pdf
C++ Nested loops, matrix and fuctions.pdfC++ Nested loops, matrix and fuctions.pdf
C++ Nested loops, matrix and fuctions.pdfyamew16788
 
Computer_Practicals-file.doc.pdf
Computer_Practicals-file.doc.pdfComputer_Practicals-file.doc.pdf
Computer_Practicals-file.doc.pdfHIMANSUKUMAR12
 
12th CBSE Practical File
12th CBSE Practical File12th CBSE Practical File
12th CBSE Practical FileAshwin Francis
 
Microsoft Word Hw#1
Microsoft Word   Hw#1Microsoft Word   Hw#1
Microsoft Word Hw#1kkkseld
 

Similar to Oops lab manual (20)

C++ file
C++ fileC++ file
C++ file
 
Tugas praktikukm pemrograman c++
Tugas praktikukm  pemrograman c++Tugas praktikukm  pemrograman c++
Tugas praktikukm pemrograman c++
 
Practica54
Practica54Practica54
Practica54
 
I have written the code but cannot complete the assignment please help.pdf
I have written the code but cannot complete the assignment please help.pdfI have written the code but cannot complete the assignment please help.pdf
I have written the code but cannot complete the assignment please help.pdf
 
Cpp programs
Cpp programsCpp programs
Cpp programs
 
2 BytesC++ course_2014_c3_ function basics&parameters and overloading
2 BytesC++ course_2014_c3_ function basics&parameters and overloading2 BytesC++ course_2014_c3_ function basics&parameters and overloading
2 BytesC++ course_2014_c3_ function basics&parameters and overloading
 
oodp elab.pdf
oodp elab.pdfoodp elab.pdf
oodp elab.pdf
 
C++ file
C++ fileC++ file
C++ file
 
CBSE Class XI Programming in C++
CBSE Class XI Programming in C++CBSE Class XI Programming in C++
CBSE Class XI Programming in C++
 
C++ TUTORIAL 3
C++ TUTORIAL 3C++ TUTORIAL 3
C++ TUTORIAL 3
 
BPOPS203 PRINCIPLES OF PROGRAMMING USING C LAB Manual.pdf
BPOPS203 PRINCIPLES OF PROGRAMMING USING C LAB Manual.pdfBPOPS203 PRINCIPLES OF PROGRAMMING USING C LAB Manual.pdf
BPOPS203 PRINCIPLES OF PROGRAMMING USING C LAB Manual.pdf
 
CP 04.pptx
CP 04.pptxCP 04.pptx
CP 04.pptx
 
Cpp c++ 1
Cpp c++ 1Cpp c++ 1
Cpp c++ 1
 
C++ practical
C++ practicalC++ practical
C++ practical
 
C++ Nested loops, matrix and fuctions.pdf
C++ Nested loops, matrix and fuctions.pdfC++ Nested loops, matrix and fuctions.pdf
C++ Nested loops, matrix and fuctions.pdf
 
Computer_Practicals-file.doc.pdf
Computer_Practicals-file.doc.pdfComputer_Practicals-file.doc.pdf
Computer_Practicals-file.doc.pdf
 
12th CBSE Practical File
12th CBSE Practical File12th CBSE Practical File
12th CBSE Practical File
 
Lecture2.ppt
Lecture2.pptLecture2.ppt
Lecture2.ppt
 
Computer Practical XII
Computer Practical XIIComputer Practical XII
Computer Practical XII
 
Microsoft Word Hw#1
Microsoft Word   Hw#1Microsoft Word   Hw#1
Microsoft Word Hw#1
 

More from Vivek Kumar Sinha (20)

Software engg unit 4
Software engg unit 4 Software engg unit 4
Software engg unit 4
 
Software engg unit 3
Software engg unit 3 Software engg unit 3
Software engg unit 3
 
Software engg unit 2
Software engg unit 2 Software engg unit 2
Software engg unit 2
 
Software engg unit 1
Software engg unit 1 Software engg unit 1
Software engg unit 1
 
Data structure
Data structureData structure
Data structure
 
Mathematics basics
Mathematics basicsMathematics basics
Mathematics basics
 
E commerce 5_units_notes
E commerce 5_units_notesE commerce 5_units_notes
E commerce 5_units_notes
 
B.ped
B.pedB.ped
B.ped
 
Subject distribution
Subject distributionSubject distribution
Subject distribution
 
Revision report final
Revision report finalRevision report final
Revision report final
 
Lession plan mis
Lession plan misLession plan mis
Lession plan mis
 
Lession plan dmw
Lession plan dmwLession plan dmw
Lession plan dmw
 
Faculty planning
Faculty planningFaculty planning
Faculty planning
 
Final presentation on computer network
Final presentation on computer networkFinal presentation on computer network
Final presentation on computer network
 
Np syllabus summary
Np syllabus summaryNp syllabus summary
Np syllabus summary
 
Internet of things
Internet of thingsInternet of things
Internet of things
 
Induction program 2017
Induction program 2017Induction program 2017
Induction program 2017
 
Vivek
VivekVivek
Vivek
 
E magzine et&amp;t
E magzine et&amp;tE magzine et&amp;t
E magzine et&amp;t
 
Mechanical engineering department (1)
Mechanical engineering department (1)Mechanical engineering department (1)
Mechanical engineering department (1)
 

Recently uploaded

Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝soniya singh
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSKurinjimalarL3
 
Application of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptxApplication of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptx959SahilShah
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxDeepakSakkari2
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxwendy cai
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )Tsuyoshi Horigome
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...Soham Mondal
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVRajaP95
 
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfCCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfAsst.prof M.Gokilavani
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxJoão Esperancinha
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Dr.Costas Sachpazis
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130Suhani Kapoor
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escortsranjana rawat
 
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionSachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionDr.Costas Sachpazis
 
Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.eptoze12
 
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...VICTOR MAESTRE RAMIREZ
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130Suhani Kapoor
 

Recently uploaded (20)

Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
 
Application of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptxApplication of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptx
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
 
Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptx
 
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptx
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
 
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfCCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
 
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionSachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
 
Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.
 
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
 

Oops lab manual

  • 1. SHRI RAWATPURA SARKAR INSTITUTE OF TECHNOLOGY-II, NEW RAIPUR CSE/4th /CN Lab/PreparedbyVivekKumarSinha SHRI RAWATPURA SARKAR INSTITUTE OF TECHNOLOGY-II NEW RAIPUR Department of ComputerScience and engineering LAB MANUAL For Object Oriented Programming Language (C++)
  • 2. SHRI RAWATPURA SARKAR INSTITUTE OF TECHNOLOGY-II, NEW RAIPUR CSE/4th /CN Lab/PreparedbyVivekKumarSinha Experiment No. 1 Aim: Write a program to check whether number is prime or not. Source: #include<iostream.h> #include<conio.h> using namespace std; int main() { int num,count=0; cout<<”Enter the number number to check:”; cin>>num; for(int i=2;i<num;i++) { if(num%i==0) { Count++; break; } } if(count==0) cout<<”it is a prime number”; else
  • 3. SHRI RAWATPURA SARKAR INSTITUTE OF TECHNOLOGY-II, NEW RAIPUR CSE/4th /CN Lab/PreparedbyVivekKumarSinha cout<<”It is not prime number”; getche(); } ********************output****************************** Enter the number to check: 97 It is a prime number Enter the number to check: 8 It is not a prime number _____________________________________________________________ ____
  • 4. SHRI RAWATPURA SARKAR INSTITUTE OF TECHNOLOGY-II, NEW RAIPUR CSE/4th /CN Lab/PreparedbyVivekKumarSinha Experiment 2 Aim:Writea program to read numberand to displaythe largest valuebetween two numbers. Source: #include<iostream.h> #include<conio.h> using namespace std; Class largest { Int d; Public: void getdata(); Void display_large(largest,largest); }; Void largest:: getdata() { cout<<”nnEnter value:”; cin>>d; } Void largest::display_largest(largest o1,largest o2) { If(o1.d>o2.d) cout<<”n object I contain largest value”; else if (o1.d<o2.d) cout<<”n object 2 contains largest value”; else cout<<”Bothare equals”; }
  • 5. SHRI RAWATPURA SARKAR INSTITUTE OF TECHNOLOGY-II, NEW RAIPUR CSE/4th /CN Lab/PreparedbyVivekKumarSinha void main() { largest o1,o2,o3; clrscr(); 01.getdata(); 02.getdata(); 03.display_largest(o1,o2); getche(); } ****************************OUTOUT************************* *************** Enter value: 12 Enter value: 22 Object 2 contains the largest value. _____________________________________________________________ ____
  • 6. SHRI RAWATPURA SARKAR INSTITUTE OF TECHNOLOGY-II, NEW RAIPUR CSE/4th /CN Lab/PreparedbyVivekKumarSinha Experiment 3 Aim:Writea program to find sum of the first natural numbers: 1+2+3+………100byusing (a) For loop (b) While Loop (c) DO….whileLoop Source: #include<iostream.h> #include<conio.h> using namespace std; int main() { int ch,sum=0; cout<<”Sumof first 100 natural numbers”; cout<<”n 1. Using for loop”; cout<<”n 2. Using while loop”; cout<<”n 3. Using do….while loop”; cout<<”Enter your choice:”; cin>>ch; switch(ch) { case 1: for(int num=1;num<=100;num++) sum=num+sum;
  • 7. SHRI RAWATPURA SARKAR INSTITUTE OF TECHNOLOGY-II, NEW RAIPUR CSE/4th /CN Lab/PreparedbyVivekKumarSinha cout<<”nn The sum of first 100 naturals number is”; cin>>sum; break; case 2: while(num=100); { sum=num+sum; num++; } cout<<”nn The sum of first 100 naturals number is”; cin>>sum; break; case 3: do { sum=num+sum; num++; } while(num=100); cout<<”nn The sum of first 100 naturals number is”; cin>>sum; break; default: cout<<”please enter the valid choice”; } getche();
  • 8. SHRI RAWATPURA SARKAR INSTITUTE OF TECHNOLOGY-II, NEW RAIPUR CSE/4th /CN Lab/PreparedbyVivekKumarSinha } ******************************OUTPUT***************************************** **** Sum of first 100 natural numbers 1. Using for loop 2. Using while loop 3. Using do….while loop Enter youe choice: 1 The sum of first natural number is :5050 ______________________________________________________________________________ _____
  • 9. SHRI RAWATPURA SARKAR INSTITUTE OF TECHNOLOGY-II, NEW RAIPUR CSE/4th /CN Lab/PreparedbyVivekKumarSinha Experiment 4 Aim:Writea program to find sum of the following series using function declaration. Sum= Source: #inlude<iostream.h> #include<conio.h> Using namespace std; Void main() { long int fact(int); // function declaration…………………………… float power (float, int); float sum,temp,x,pow; int sign,I,n; long int factval; cout<<”Enter a value of n?”; cin>>n; cout<<”Enter the value of X?”; cin>>x; i=3; sum=x; sign=1; while(i<=n)
  • 10. SHRI RAWATPURA SARKAR INSTITUTE OF TECHNOLOGY-II, NEW RAIPUR CSE/4th /CN Lab/PreparedbyVivekKumarSinha { factval=fact(i); pow=power(x,i); sign=(-1)*sign; temp=sign*pow/factval; sum=sum+temp; i=i+2; } Cout<<”sumog the series is :”; getche(); } // end of the main function…………………………………. long int fact( int max) { long int value; value=1; for(int i=1;i<=max;++i) value=value*I; return(value); } float power(float x, int n) { float value2; value2=1; for(int j=1;j<=n;++j) value2=value2*x; return ( value2);
  • 11. SHRI RAWATPURA SARKAR INSTITUTE OF TECHNOLOGY-II, NEW RAIPUR CSE/4th /CN Lab/PreparedbyVivekKumarSinha } ***************************OUTPUT************************** ***** Enter a value for n? 7 Enter a value for x? 1 Sumof the series is: 0.841468
  • 12. SHRI RAWATPURA SARKAR INSTITUTE OF TECHNOLOGY-II, NEW RAIPUR CSE/4th /CN Lab/PreparedbyVivekKumarSinha Experiment 5 Aim:Writea program to read the elementsof the given twomatricesof order n*n and to perform the matrix multiplication. Source: #inlude<iostream.h> #include<conio.h> #define MAX 100 Using namespace std; Void main() { void output(float a[max] [max], int n); void mul(float a[max][ max], float b[max][ max],int n); float a[max][max],b[max][max]; Int I,j,n; cout<<”orderofmatrix A “<<endl; cin>>n; cout<<”enter the elements for the matrix A:”<<endl; for(i=0;i<=n-1;++i) { for(j=0;j<=n-1;++j) cin>>a[i][j]; } cout<<”orderof matrix B “<<endl; cin>>n; cout<<”enter the elements for the matrix B:”<<endl; for(i=0;i<=n-1;++i) { for(j=0;j<=n-1;++j) cin>>b[i][j]; } cout<<”outputA[i][j] “<<endl; output(a,n);
  • 13. SHRI RAWATPURA SARKAR INSTITUTE OF TECHNOLOGY-II, NEW RAIPUR CSE/4th /CN Lab/PreparedbyVivekKumarSinha cout<<”outputB[i][j] “<<endl; output(b,n); mul(a,b,n); getche(); } // end of the main function……………………………. // function definition……………………………………… void mul(float a[max][ max], float b[max][ max],int n) { void output(float c[max][ max],int n); float c[max][ max]; int I,j,k; for(i=0;i<=n-1;++i) { for(j=0;j<=n-1;++j) { c[i][j]=0.0; for(k=0;k<=n-1;++k) c[i][j]=c[i][j]+a[i][j]*b[k][j]; } cout<<endl; cout<<”Outputof c[i][j] matrix”<<endl; output(c,n); } void output(float x[max][max],int n) { int I,j; for (i=0; i<=n-1;++i) { for(j=0;j<=n-1;++j) cout<<x[i][j]<<’t’; cout<<endl; } }
  • 14. SHRI RAWATPURA SARKAR INSTITUTE OF TECHNOLOGY-II, NEW RAIPUR CSE/4th /CN Lab/PreparedbyVivekKumarSinha ****************************OUTPUT************************* ***** Order of matrix A 3 Enter the elements of matrix A: 3 3 3 3 3 3 3 3 3 Order of matrix B 3 Enter the elements of matrix B: 3 3 3 3 3 3 3 3 3 Output A[i][j] 3 3 3 3 3 3 3 3 3 Output B[i][j] 3 3 3 3 3 3 3 3 3 Output of C[i][j] matrix 27 27 27 27 27 27 27 27 27
  • 15. SHRI RAWATPURA SARKAR INSTITUTE OF TECHNOLOGY-II, NEW RAIPUR CSE/4th /CN Lab/PreparedbyVivekKumarSinha Experiment 6 Aim:Writea program to exchangethe contents of twovariablesby using (a) call by value(b) call by reference. Source: (a) // Call by value ……………… #inlude<iostream.h> #include<conio.h> Using namespace std; Void main() { int x,y; void swap(int,int); x=100; y=20; cout<<”values before swap ()”<<endl; cout<<”x = ”<< x <<”and y = ”<<y<<endl; swap(x,y); cout<<”values after swap swap ()”<<endl; cout<<”x = ”<< x <<”and y = ”<<y<<endl; getche(); } // end of the main function………………………………
  • 16. SHRI RAWATPURA SARKAR INSTITUTE OF TECHNOLOGY-II, NEW RAIPUR CSE/4th /CN Lab/PreparedbyVivekKumarSinha Void swap(int x,int y) // values will not be swapped…………………….. { Int temp; Temp=x; X=y; Y=temp; } *************************output************************** ********** Values before swap () X=100 and y==20 Values after swap () X=100 and y==20 (b) call by reference………………………………… #inlude<iostream.h> #include<conio.h> Using namespace std; Void main() { int x,y; void swap(int *x,int *y); x=100; y=20; cout<<”values before swap ()”<<endl; cout<<”x = ”<< x <<”and y = ”<<y<<endl;
  • 17. SHRI RAWATPURA SARKAR INSTITUTE OF TECHNOLOGY-II, NEW RAIPUR CSE/4th /CN Lab/PreparedbyVivekKumarSinha swap(x,y); cout<<”values after swap swap ()”<<endl; cout<<”x = ”<< x <<”and y = ”<<y<<endl; getche(); } // end of the main function……………………………… Void swap(int *x, int * y) // values will be swapped…………………….. { int temp; temp=*x; *x=*y; *y=temp; } *************************output************************** ********** Values before swap () X=100 and y==20 Values after swap () X=20 and y==100
  • 18. SHRI RAWATPURA SARKAR INSTITUTE OF TECHNOLOGY-II, NEW RAIPUR CSE/4th /CN Lab/PreparedbyVivekKumarSinha Experiment 7 Aim:Writea program to perform the following operationsof a complex numberusinga structure. 1. Addition of two complex numbers 2. Subtraction of two complex numbers 3. Multiplication of twocomplex numbers 4. Division of two complex numbers Source: Struct complex { float real; float imag; }; complex add (complex a,complex b); complex sub (complex a,complex b); complex mul (complex a,complex b); complex div (complex a,complex b); #inlude<iostream.h> #include<conio.h> using namespace std; void main() { complex a,b,c; int ch; void menu(void); cout<<”Enter the first complex number n”; cin>>a.real>>a.imag; cout<<”Enter the second complex number n”;
  • 19. SHRI RAWATPURA SARKAR INSTITUTE OF TECHNOLOGY-II, NEW RAIPUR CSE/4th /CN Lab/PreparedbyVivekKumarSinha cin>>b.real>>b.imag; menu(); while((ch = getchar()) !=’q’) { switch (ch) { case ‘a’: c = add (a,b); cout<<”Addition of two complex number n”; cout<<c.real<<”+ i”<< c.imag << endl; ` break; case ‘s’: c = sub (a,b); cout<<”Substractionof two complex number n”; cout<<c.real<<”+ i”<< c.imag << endl; ` break; case ‘m’: c = mul (a,b); cout<<”Multiplication of two complex number n”; cout<<c.real<<”+ i”<< c.imag << endl; ` break; case ‘d’: c = div (a,b); cout<<”Division of two complex number n”; cout<<c.real<<”+ i”<< c.imag << endl; ` break; } } } // ……………..End ofthe main function…………………………… void menu ()
  • 20. SHRI RAWATPURA SARKAR INSTITUTE OF TECHNOLOGY-II, NEW RAIPUR CSE/4th /CN Lab/PreparedbyVivekKumarSinha { cout<< “complex number operations nn”; cout<<”menu()”; cout<<”a -> Addition n”; cout<<”s -> Substraction n”; cout<<”m -> Multiplication n”; cout<<”d -> Division n”; cout<<”q -> Quit n ”; cout<<” option please…………… n ”; } complex add (struct complex a, struct complex b) { complex c; c.real=a.real+b.real; c.imag=a.imag+b.imag; return(c); } complex sub (struct complex a, struct complex b) { complex c; c.real=a.real - b.real; c.imag=a.imag + b.imag; return(c); } complex mul (struct complex a, struct complex b) { complex c; c.real=(a.real * b.real) – (a.imag * b.imag); c.imag=(a.real * b.real) + (a.imag * b.imag); return(c); } complex div (struct complex a, struct complex b) {
  • 21. SHRI RAWATPURA SARKAR INSTITUTE OF TECHNOLOGY-II, NEW RAIPUR CSE/4th /CN Lab/PreparedbyVivekKumarSinha complex c; float temp; temp = (b.real*b.real) + (b.imag*b.imag); c.real=((a.real * b.real) + (a.imag * b.imag))/temp; c.imag=((a.real * b.real) - (a.imag * b.imag))/temp; return(c); } ***********************OUTPUT************************* ********** Enter the first complex number 1 1 Enter the second number 2 2 Complex number operations Menu() a -> Addition s -> Substraction m -> Multiplication d -> Divison q -> Quit or Exit? Option, please ? a Additon of two complex numbers 3 + i3 s Substraction of two complex numbers -1i-1 m Multiplication of two complex numbers 0i4 d Division of two complex numbers 0.5i0
  • 22. SHRI RAWATPURA SARKAR INSTITUTE OF TECHNOLOGY-II, NEW RAIPUR CSE/4th /CN Lab/PreparedbyVivekKumarSinha q Experiment 8 Aim:Writea program to perform the swapping of twodata itemsof integers, floating pointnumberand character type withthe help of function overloading. Source: #inlude<iostream.h> #include<conio.h> using namespace std; void swap (int &ix, int &iy); void swap (float &ix, float &iy); void swap (char &ix, char &iy); void main() { int ix,iy; float fx, fy; char cx,cy; cout<<”enter the two integers n”<<endl; cin>> ix>>iy; cout<<”enter the two floating point numbers n”<<endl; cin>> fx>>fy; cout<<”enter the two characters n”<<endl;
  • 23. SHRI RAWATPURA SARKAR INSTITUTE OF TECHNOLOGY-II, NEW RAIPUR CSE/4th /CN Lab/PreparedbyVivekKumarSinha cin>> cx>>cy; cout<<”swappingof integers n”; cout<<”ix = ” <<ix<< “iy = ”<<iy<<endl; swap(ix,iy); cout<<”After swapping ”<<endl; cout<<”ix = ” <<ix<< “iy = ”<<iy<<endl; cout<<endl; cout<<”swapping of floating point numbers n”; cout<<”fx = ” <<fx<< “fy = ”<<fy<<endl; swap(fx,fy); cout<<”After swapping ”<<endl; cout<<”fx = ” <<fx<< “fy = ”<<fy<<endl; cout<<endl; cout<<”swapping of characters n”; cout<<”cx= ” <<cx<< “cy= ”<<cy<<endl; swap(cx,cy); cout<<”After swapping ”<<endl; cout<<”cx= ” <<cx<< “cy= ”<<cy<<endl; cout<<endl; } //……END OF THE main FUNCTION………………………… void swap (int &a, int &b)
  • 24. SHRI RAWATPURA SARKAR INSTITUTE OF TECHNOLOGY-II, NEW RAIPUR CSE/4th /CN Lab/PreparedbyVivekKumarSinha { int temp; temp=a; a=b; b=temp; } void swap (float &a, float &b) { float temp; temp=a; a=b; b=temp; } void swap (char &a, char &b) { char temp; temp=a; a=b; b=temp; } ***************************OUTPUT********************* **********
  • 25. SHRI RAWATPURA SARKAR INSTITUTE OF TECHNOLOGY-II, NEW RAIPUR CSE/4th /CN Lab/PreparedbyVivekKumarSinha Enter any two integers 100 200 Enter any two floating point numbers -11 22.22 Enter any two characters s t swapping of integers ix = 100 iy = 200 After swapping ix = 200 iy = 100 swapping of floating point numbers fx = -11.11 fy = 22.219099 After swapping fx = 22.219099 fy = -11.11 swapping of characters cx = s cy = t After swapping cx = t cy = s ________________________________________________________
  • 26. SHRI RAWATPURA SARKAR INSTITUTE OF TECHNOLOGY-II, NEW RAIPUR CSE/4th /CN Lab/PreparedbyVivekKumarSinha Experiment 9 Aim: Write a C++ program to to generate a fibonacciseries by overloading: (a)Prefix overloading (b) postfix overloading Source: (a) #inlude<iostream.h> #include<conio.h> using namespace std; class fibonnaci { private: unsigned long int f0,f1,fib; public: fibonacci(); void operater++(); void display (); }; fibonacci :: fibonacci() { fo=0;
  • 27. SHRI RAWATPURA SARKAR INSTITUTE OF TECHNOLOGY-II, NEW RAIPUR CSE/4th /CN Lab/PreparedbyVivekKumarSinha f1=1; fib=f0+f1; } void fibonacci :: display () { cout<<fib<<’t’; } voiod fibonacci :: operator++( ) { fo=f1; f1=fib; fib=f0+f1; } void main() { fibonacci obj; int n; cout<< “How many fibonacci numbers are to be ”; cout<<”Displayed ? n”: cin>>n; for(int i=0; i<=n=1;++i)
  • 28. SHRI RAWATPURA SARKAR INSTITUTE OF TECHNOLOGY-II, NEW RAIPUR CSE/4th /CN Lab/PreparedbyVivekKumarSinha { obj.display(); ++obj; } } ……………………..ENDof the main function …………………………………. (b) #inlude<iostream.h> #include<conio.h> using namespace std; class fibonnaci { private: unsigned long int f0,f1,fib; public: fibonacci(); // ………………..contructor…………………………. void operater++( int ); void display (); }; fibonacci :: fibonacci() {
  • 29. SHRI RAWATPURA SARKAR INSTITUTE OF TECHNOLOGY-II, NEW RAIPUR CSE/4th /CN Lab/PreparedbyVivekKumarSinha fo=0; f1=1; fib=f0+f1; } void fibonacci :: display () { cout<<fib<<’t’; } fibonacci fibonacci :: operator++(int x) { fo=f1; f1=fib; fib=f0+f1; return *this; } void main() { fibonacci obj; int n; cout<< “How many fibonacci numbers are to be ”; cout<<”Displayed ? n”: cin>>n;
  • 30. SHRI RAWATPURA SARKAR INSTITUTE OF TECHNOLOGY-II, NEW RAIPUR CSE/4th /CN Lab/PreparedbyVivekKumarSinha for(int i=0; i<=n=1;++i) { obj.display(); obj++; } } // …………………...End ofthe main()…………………. Experiment 10 Aim:Writea program to perform simplearithmeticoperationsof two complex numbersusing operator overloading. Source: Struct complex { float real; float imag; }; complex + (complex a,complex b); complex - (complex a,complex b); complex * (complex a,complex b); complex / (complex a,complex b); #inlude<iostream.h> #include<conio.h> using namespace std; void main() { complex a,b,c; int ch; void menu(void); cout<<”Enter the first complex number n”; cin>>a.real>>a.imag; cout<<”Enter the second complex number n”; cin>>b.real>>b.imag;
  • 31. SHRI RAWATPURA SARKAR INSTITUTE OF TECHNOLOGY-II, NEW RAIPUR CSE/4th /CN Lab/PreparedbyVivekKumarSinha menu(); while((ch = getchar()) !=’q’) { switch (ch) { case ‘a’: c = add (a,b); cout<<”Addition of two complex number n”; cout<<c.real<<”+ i”<< c.imag << endl; ` break; case ‘s’: c = sub (a,b); cout<<”Substractionof two complex number n”; cout<<c.real<<”+ i”<< c.imag << endl; ` break; case ‘m’: c = mul (a,b); cout<<”Multiplication of two complex number n”; cout<<c.real<<”+ i”<< c.imag << endl; ` break; case ‘d’: c = div (a,b); cout<<”Division of two complex number n”; cout<<c.real<<”+ i”<< c.imag << endl; ` break; } } } // ……………..End ofthe main function…………………………… void menu () {
  • 32. SHRI RAWATPURA SARKAR INSTITUTE OF TECHNOLOGY-II, NEW RAIPUR CSE/4th /CN Lab/PreparedbyVivekKumarSinha cout<< “complex number operations nn”; cout<<”menu()”; cout<<”a -> Addition n”; cout<<”s -> Substraction n”; cout<<”m -> Multiplication n”; cout<<”d -> Division n”; cout<<”q -> Quit n ”; cout<<” option please…………… n ”; } complex + (struct complex a, struct complex b) { complex c; c.real=a.real+b.real; c.imag=a.imag+b.imag; return(c); } complex - (struct complex a, struct complex b) { complex c; c.real=a.real - b.real; c.imag=a.imag + b.imag; return(c); } complex * (struct complex a, struct complex b) { complex c; c.real=(a.real * b.real) – (a.imag * b.imag); c.imag=(a.real * b.real) + (a.imag * b.imag); return(c); } complex / (struct complex a, struct complex b) { complex c;
  • 33. SHRI RAWATPURA SARKAR INSTITUTE OF TECHNOLOGY-II, NEW RAIPUR CSE/4th /CN Lab/PreparedbyVivekKumarSinha float temp; temp = (b.real*b.real) + (b.imag*b.imag); c.real=((a.real * b.real) + (a.imag * b.imag))/temp; c.imag=((a.real * b.real) - (a.imag * b.imag))/temp; return(c); } ***********************OUTPUT************************* ********** Enter the first complex number 1 1 Enter the second number 2 2 Complex number operations Menu() a -> Addition s -> Substraction m -> Multiplication d -> Divison q -> Quit or Exit? Option, please ? a Additon of two complex numbers 3 + i3 s Substraction of two complex numbers -1i-1 m Multiplication of two complex numbers 0i4 d Division of two complex numbers 0.5i0
  • 34. SHRI RAWATPURA SARKAR INSTITUTE OF TECHNOLOGY-II, NEW RAIPUR CSE/4th /CN Lab/PreparedbyVivekKumarSinha q _______________________________________________________
  • 35. SHRI RAWATPURA SARKAR INSTITUTE OF TECHNOLOGY-II, NEW RAIPUR CSE/4th /CN Lab/PreparedbyVivekKumarSinha