Professional Documents
Culture Documents
Communication Engineering
Program : B.Tech in ECE
IV Semester
2020-24
Rukmini Educational
Charitable Trust
www.reva.edu.in
Vision of the University
‘’REVA University aspires to become an innovative university by developing excellent human
resources with leadership qualities, ethical and moral values, research culture and innovative skills
through higher education of global standards”
PEO -1: To have successful professional careers in industry, government, academia, and military as
innovative engineers.
PEO -2: To successfully solve engineering problems associated with the lifecycle of Electronics and
Communication Systems either leading a team or as a team member.
PEO -3: To continue to learn and advance their careers through activities such as participation in
professional organizations, attainment of professional certification for lifelong
learning and seeking higher education.
PEO -4: To be active members ready to serve the society locally and internationally and will undertake
entrepreneurship for the growth of economy and to generate employment.
Program Outcomes (POs)
PSO-1: Isolate and solve complex problems in the domains of Electronics and Communication
Engineering using latest hardware and software tools and technologies, along with analytical and
managerial skills to arrive at cost effective and optimum solutions either independently or as a team.
PSO-2: Implant the capacity to apply the concepts of electronics, communications, signal processing,
VLSI, embedded systems, etc. in the design, development and implementation of application oriented
engineering systems.
PSO-3: Design, Model, Analyze and Build Electronics and Communication Systems to solve real life
and industry problems.
REVA University School of ECE
CONTENTS
Write C++ program to implement Stack and perform push, pop, &
7 display operation on it. 25-27
Object Oriented Programming and Data Structures using C++ B20EN0404 Sem:IV P a g e |1
REVA University School of ECE
Course Title Object Oriented Programming and Data Course Type HC(Integrated)
Structures using C++
Course Code B20EN0404 Credits 3 Class IV Semester
LTP Credits Contact Contact
Total Number of
Hours Hours Assessment in
Classes Per
Lecture 2 2 2 Weightage
Semester
Tutorial - - -
Practice 1 2 2 Theory Practical IA SEE
Total 3 4 4 28 28 50% 50%
COURSE OVERVIEW:
The purpose of this course is to provide the solid foundations in the basic concepts of data
structures algorithms and C++ programming language. The Data Structures and C++ Programming
Language are a very important to develop Application Software, System Software, Operating Systems,
and Network Simulators as it employees Object Oriented Programming (OOP) aspect. This course has
important features of OOP like Polymorphism, Inheritance which are not present in C Programming
Language. Survey of fundamental data structures (array, linked lists, queue, stack) and how to use
them in C++. This course then delves deeper into the design, analysis and implementation of such data
structures.
COURSE OBJECTIVES:
The objectives of this course are: 1. Provide insights into the role of programming
Languages like C and C++ in design and development. 2. Provide a concise but through introduction to
the fundamental concepts of Classes, Objects, Inheritance and polymorphism in C++. 3. Discuss insights
into the basic concepts of data structures and algorithms. 4. Implement basic concepts about arrays,
stacks, queues and linked lists.
COURSE OUTCOMES (COs)
On successful completion of this course; the student shall be able to: Index sheet.
CO# Course Outcomes POs PSOs
CO4 Identify and classify various types of data structures 1,2,3,,5 1,2,3
CO5 Write C++ programs to implement data structures like array, stack, queue 1,2,3,5 1,2,3
and linked list.
Object Oriented Programming and Data Structures using C++ B20EN0404 Sem:IV P a g e |2
REVA University School of ECE
Bloom’s Level
CO#
Remember Understand Apply(L3) Analyze(L4) Evaluate Create(L6)
(L1) (L2) (L5)
CO1
CO2
CO3
CO4
CO5
CO#/
PO10
PO11
PO12
PSO1
PSO2
PSO3
PO1
PO2
PO3
PO4
PO5
PO6
PO7
PO8
PO9
POs
CO1 3 3 2 2 2 2 1
CO2 4 3 2 3 3 2 1
CO3 3 3 2 3 3 3 2
CO4 3 4 3 3 3 3 2
CO5 3 3 4 2 3 2 3
Object Oriented Programming and Data Structures using C++ B20EN0404 Sem:IV P a g e |3
REVA University School of ECE
Introduction
You will learn about difference between C and C++ language i.e. C vs. C++. C programming
language was developed by Dennis Ritchie in the year 1972 while C++ programming language
was developed by Bjarne Stroustrup in the year 1983. C++ is a superset of C and contains all the
features of C language. Still there are some differences between C and C++. Below the list of
some main difference between C and C++ programming language.
C C++
Object Oriented Programming and Data Structures using C++ B20EN0404 Sem:IV P a g e |4
REVA University School of ECE
8. In C In C++
• scanf() Function used for Input. • Cin>> Function used for Input.
• printf() Function used for output. • Cout<< Function used for output
9. Mapping between Data and Function is
difficult and complicated.
9. Mapping between Data and Function
canbe used using "Objects
10. In C, we can call main() Function through 10. In C++, we cannot call main() Function
other Functions through other functions.
11. C requires all the variables to be defined 11. C++ allows the declaration of variable
atthe starting of a scope. anywhere in the scope i.e at time of its
Firstuse.
13. In C, malloc() and calloc() Functions are 13. In C++, new and delete operators
used for Memory Allocation and free() areused for Memory Allocating and
function for memory Deallocating. Deallocating.
14. It supports built-in and primitive 14. It support both built-in and user
datatypes. definedata types.
15. In C, Exception Handling is not 15. In C++, Exception Handling is done
present. with Try and Catch block.
Object Oriented Programming and Data Structures using C++ B20EN0404 Sem:IV P a g e |5
REVA University School of ECE
Object Oriented Programming and Data Structures using C++ B20EN0404 Sem:IV P a g e |6
REVA University School of ECE
Click on Save as, and save file with your SRN other than C drive
Click on file, Select New source and start typing the program.
Object Oriented Programming and Data Structures using C++ B20EN0404 Sem:IV P a g e |7
REVA University School of ECE
Click on Execute and select Compile and Run or press F11 in keyboard
Object Oriented Programming and Data Structures using C++ B20EN0404 Sem:IV P a g e |8
REVA University School of ECE
1a. Write a C++ program to generate all the prime numbers between 1 to 20.
#include<iostream>
using namespace std;
int main()
{
int i, j, count = 0;
cout << "\n Prime Numbers Between 1 to 20 :\n";
for (i = 2; i <= 20; i++)
{
count = 0;
for (j = 2; j < i; j++)
{
if (I % j == 0)
{
count++;
break;
}
}
if (count == 0)
{
cout << i << "\n";
}
}
return 0;
}
OUTPUT:
Prime number between 1 to 20 :
2
3
5
7
11
13
17
19
Object Oriented Programming and Data Structures using C++ B20EN0404 Sem:IV P a g e |9
REVA University School of ECE
1b. Write a C++ program to find both the largest and smallest number in an array of size 10.
#include<iostream>
using namespace std;
int main ()
{
int arr[10], n, i, max, min;
cout << "Enter the size of the array : ";
cin >> n;
cout << "Enter the elements of the array : ";
for (i = 0; i < n; i++)
cin >> arr[i];
max = arr[0];
for (i = 0; i < n; i++)
{
if (max < arr[i])
max = arr[i];
}
cout << "Largest element : " << max;
min = arr[0];
for (i = 0; i < n; i++)
{
if (min > arr[i])
min = arr[i];
}
cout << "Smallest element : " << min;
return 0;
}
OUTPUT:
Enter the size of the array: 5
Enter the elements of the array: 1 2 3 4 5
Largest element: 5
Smallest element: 1
Object Oriented Programming and Data Structures using C++ B20EN0404 Sem:IV P a g e | 10
REVA University School of ECE
1c. Write a Program to illustrate New and Delete Keywords for dynamic memory allocation.
int main() {
// declare an int & float pointer
int* pointInt;
float* pointFloat;
OUTPUT
45
45.45
//for a set of memories (Program to store SGPA of n number of students and display it)
#include <iostream>
using namespace std;
int main() {
int num;
cout << "Enter total number of students: ";
cin >> num;
float* ptr;
Object Oriented Programming and Data Structures using C++ B20EN0404 Sem:IV P a g e | 11
REVA University School of ECE
Object Oriented Programming and Data Structures using C++ B20EN0404 Sem:IV P a g e | 12
REVA University School of ECE
2. Write a C++ Program to display Names, Roll No., and grades of 3 students who have appeared in
the examination. Declare the class of name, Roll No. and grade. Create an array of class objects. Read
and display the contents of the array.
#include <iostream>
using namespace std;
class Student_Info
{
int roll_number;
char student_name[50], grade[2];
public:
void read_data(int count)
{
cout << "Enter student " << count + 1 << " information ---------\n";
cout << "Name of the Student (Max. 50 characters only): ";
cin >> student_name;
cout << "Roll Number: ";
cin >> roll_number;
cout << "Grade (O, A+, A, B+, B, C, D, F): ";
cin >> grade;
cout << "\nStudent information with roll number " << roll_number << " has saved!";
}
void display_data(int count) {
cout << "\n\n******** Student " << count + 1 << " Information ********";
cout << "\nName of the Student: " << student_name;
cout << "\nRoll Number: " << roll_number;
cout << "\nGrade Secured: " << grade;
cout << "\n---------------------------------------\n";
}
};
int main() {
Student_Info stud[3];
int i;
for (i = 0; i < 3; i++)
stud[i].read_data(i);
cout << "\n\n+++++++++++++++++++++++++++++++++++++++++++++++\n";
cout << "The information of 3 students has been saved.";
cout << "\n+++++++++++++++++++++++++++++++++++++++++++++++\n";
for (i = 0; i < 3; i++)
Object Oriented Programming and Data Structures using C++ B20EN0404 Sem:IV P a g e | 13
REVA University School of ECE
stud[i].display_data(i);
return 0;
}
OUTPUT:
--------- Enter student 1 information ---------
Name of the Student (Max. 50 characters only): sri
Roll Number: 25
Grade (O, A+, A, B+, B, C, D, F): A
+++++++++++++++++++++++++++++++++++++++++++++++
The information of 3 students has been saved.
+++++++++++++++++++++++++++++++++++++++++++++++
Object Oriented Programming and Data Structures using C++ B20EN0404 Sem:IV P a g e | 14
REVA University School of ECE
3. Given that an EMPLOYEE class contains following members: data members: Employee
number, Employee name, Basic, DA, IT, Net Salary and print data members.
#include <iostream>
#include<conio.h>
class employee
{
int emp_number;
char emp_name[20];
float emp_basic;
float emp_da;
float emp_it;
float emp_net_sal;
public:
void get_emp_details ();
float find_net_salary (float basic, float da, float it);
void show_emp_details ();
};
Object Oriented Programming and Data Structures using C++ B20EN0404 Sem:IV P a g e | 15
REVA University School of ECE
int main()
{
employee emp;
emp.get_emp_details();
emp.show_emp_details();
return 0;
}
OUTPUT:
Enter employee number: 112
Enter employee name: SREENIVAS
Enter employee basic: 10000
Enter employee DA: 500
Enter employee IT: 200
Object Oriented Programming and Data Structures using C++ B20EN0404 Sem:IV P a g e | 16
REVA University School of ECE
4. Write a C++ Program to illustrate default constructor, parameterized constructor and copy
constructors.
#include <iostream>
using namespace std;
// declare a class
class Wall {
private:
double length;
public:
// default constructor to initialize variable
Wall () {
length = 5.5;
cout << "Creating a wall." << endl;
cout << "Length = " << length << endl;
}
};
int main () {
Wall wall1;
return 0;
}
OUTPUT:
Creating a Wall
Length = 5.5
#include <iostream>
using namespace std;
// declare a class
class Wall {
private:
double length;
double height;
Object Oriented Programming and Data Structures using C++ B20EN0404 Sem:IV P a g e | 17
REVA University School of ECE
public:
// parameterized constructor to initialize variables
Wall(double len, double hgt) {
length = len;
height = hgt;
}
double calculateArea() {
return length * height;
}
};
int main() {
// create object and initialize data members
Wall wall1(10.5, 8.6);
Wall wall2(8.5, 6.3);
return 0;
}
OUTPUT:
Area of Wall 1: 90.3
Area of Wall 2: 53.55
#include <iostream>
using namespace std;
// declare a class
class Wall {
private:
double length;
double height;
public:
Object Oriented Programming and Data Structures using C++ B20EN0404 Sem:IV P a g e | 18
REVA University School of ECE
double calculateArea() {
return length * height;
}
};
int main() {
// create an object of Wall class
Wall wall1(10.5, 8.6);
return 0;
}
OUTPUT:
Area of Wall 1: 90.3
Area of Wall 2: 90.3
Object Oriented Programming and Data Structures using C++ B20EN0404 Sem:IV P a g e | 19
REVA University School of ECE
#include <iostream>
using namespace std;
class base //single base class
{
public:
int x;
void getdata()
{
cout << "Enter the value of x = "; cin >> x;
}
};
int main()
{
derive a; //object of derived class
a.getdata();
a.readdata();
a.product();
return 0;
}
OUTPUT:
Enter the value of x = 3
Enter the value of y = 4
Product = 12
Object Oriented Programming and Data Structures using C++ B20EN0404 Sem:IV P a g e | 20
REVA University School of ECE
class A
{
public:
A() {
cout << "A's constructor called" << endl;
}
};
class B
{
public:
B() {
cout << "B's constructor called" << endl;
}
};
int main()
{
C c;
return 0;
}
OUTPUT:
B's constructor called
A's constructor called
C's constructor called
Object Oriented Programming and Data Structures using C++ B20EN0404 Sem:IV P a g e | 21
REVA University School of ECE
This type of polymorphism is also referred to as static binding or early binding. It takes place
during compilation. We use function overloading and operator overloading to achieve compile-
time polymorphism.
Function Overloading
#include <iostream>
using namespace std;
int add(int a, int b)
{
return a + b;
}
int main()
{
int x = 3, y = 7, z = 12;
double n1 = 4.56, n2 = 13.479;
cout << "x+y = " << add(x, y) << endl;
cout << "x+y+z = " << add(x, y, z) << endl;
cout << "n1+n2 = " << add(n1, n2);
return 0;
}
Output:
x+y = 10
x+y+z = 22
n1+n2 = 18.039
Object Oriented Programming and Data Structures using C++ B20EN0404 Sem:IV P a g e | 22
REVA University School of ECE
Operator Overloading
#include <iostream>
using namespace std;
class complex
{
private:
float real, imag;
public:
complex(float r = 0, float i = 0)
{
real = r;
imag = i;
}
complex operator + (complex const &obj)
{
complex result;
result.real = real + obj.real;
result.imag = imag + obj.imag;
return result;
}
void display()
{
cout << real << "+i" << imag << endl;
}
};
int main() {
complex c1(12.4, 6), c2(7.9, 8);
complex c3 = c1 + c2;
c3.display();
return 0;
}
OUTPUT:
20.3+i14
Object Oriented Programming and Data Structures using C++ B20EN0404 Sem:IV P a g e | 23
REVA University School of ECE
Function Overriding
#include <iostream>
using namespace std;
class base
{
public:
virtual void display ()
{
cout << "Function of base class" << endl;
}
};
int main ()
{
derived d1;
d1.display();
return 0;
}
Output:
Function of derived class
Object Oriented Programming and Data Structures using C++ B20EN0404 Sem:IV P a g e | 24
REVA University School of ECE
7. Write C++ program to implement Stack and perform push, pop, & display operation on it.
#include<iostream>
using namespace std;
class stack
{
int s[20];
public:
int max;
void push();
void pop();
void display();
};
void stack::push()
{
int x;
if (top == (max - 1))
cout << "Stack is full"<<endl;
else
{
cout << "enter data:";
cin >> x;
top = top + 1;
s[top] = x;
}
}
void stack::pop()
{
if (top == -1)
cout << "stack is empty"<<endl;
else
{
cout << "poped element: " << s[top];
s[top--] = '\0';
}
}
Object Oriented Programming and Data Structures using C++ B20EN0404 Sem:IV P a g e | 25
REVA University School of ECE
void stack::display()
{
cout << "displaying the contents of stack:\n";
if (top == -1)
cout << "stack is empty" << endl;
else
{
for (i = 0; i <= top; i++)
cout << s[i] << "\t";
cout << "\n";
}
}
int main()
{
stack sa;
cout << "enter the range:";
cin >> sa.max;
while (1)
{
cout << "\n1.push \n2.pop \n3.display \n4.exit";
cout << "\n enter your choice:";
cin >> n;
switch (n)
{
case 1:
sa.push();
break;
case 2:
sa.pop();
break;
case 3:
sa.display();
break;
case 4:
exit(0);
default:
cout << "Invalid option";
}
}
Object Oriented Programming and Data Structures using C++ B20EN0404 Sem:IV P a g e | 26
REVA University School of ECE
Output:
enter the range:2
1.push
2.pop
3.display
4.exit
enter your choice:3
displaying the contents of stack:
stack is empty
1.push
2.pop
3.display
4.exit
enter your choice:2
stack is empty
1.push
2.pop
3.display
4.exit
enter your choice:
Object Oriented Programming and Data Structures using C++ B20EN0404 Sem:IV P a g e | 27
REVA University School of ECE
8. Write C++ program to implement Queue and perform enqueue, dequeue, & display
operation on it.
#include<iostream>
#define SIZE 5
using namespace std;
int items[SIZE], front = -1, rear = -1, element;
class Queue
{
public:
bool isFull();
bool isEmpty();
void enQueue();
void deQueue();
void display();
};
void Queue::enQueue()
{
if (Queue:: isFull())
{
cout << "Queue is full";
} else
{
if (front == -1)
front = 0;
cout << "Enter the elemented to be inserted: ";
cin >> element;
rear++;
Object Oriented Programming and Data Structures using C++ B20EN0404 Sem:IV P a g e | 28
REVA University School of ECE
items[rear] = element;
}
}
cout << "\n Front = " << front << "\t Rear = " << rear << endl;
}
}
int main()
{
Queue q;
Object Oriented Programming and Data Structures using C++ B20EN0404 Sem:IV P a g e | 29
REVA University School of ECE
int choice;
while (1)
{
cout << "\n1.Insert \n2.Delete \n3.Display \n4.Exit";
cout << "\n enter ur choice:";
cin >> choice;
switch (choice)
{
case 1:
q.enQueue();
break;
case 2:
q.deQueue();
break;
case 3:
q.display();
break;
case 4:
exit(0);
default:
cout << "Invalid Choice";
}
}
}
Output:
1.Insert
2.Delete
3.Display
4.Exit
enter ur choice:1
Enter the elemented to be inserted: 25
1.Insert
2.Delete
3.Display
4.Exit
enter ur choice:1
Enter the elemented to be inserted: 25
Object Oriented Programming and Data Structures using C++ B20EN0404 Sem:IV P a g e | 30
REVA University School of ECE
1.Insert
2.Delete
3.Display
4.Exit
enter ur choice:2
Deleted elemted : 25
1.Insert
2.Delete
3.Display
4.Exit
enter ur choice:3
Queue elements are :
25
Front = 1 Rear = 1
1.Insert
2.Delete
3.Display
4.Exit
enter ur choice:1
Queue elements are :
25 27
Front = 1 Rear = 2
1.Insert
2.Delete
3.Display
4.Exit
enter ur choice:1
Enter the elemented to be inserted: 22
1.Insert
2.Delete
3.Display
4.Exit
enter ur choice:2
Deleted elemted : 25
1.Insert
2.Delete
3.Display
4.Exit
enter ur choice:
Object Oriented Programming and Data Structures using C++ B20EN0404 Sem:IV P a g e | 31
REVA University School of ECE
9a) Write C++ program to implement Singly Linked List and perform operation adding new
node at the beginning of Linked List’ & display node values.
9b) Write C++ program to implement Singly Linked List and perform operation deleting a first
node from the Linked List & display node values.
#include<iostream>
using namespace std;
class SLL
{
public:
void insert_begin();
void delete_begin();
void display();
};
int main()
{
int choice;
SLL lo;
while (1)
{
cout << endl << "---------------------------------" << endl;
cout << endl << "Operations on singly linked list" << endl;
cout << endl << "---------------------------------" << endl;
cout << "1.Insert Node at beginning" << endl;
cout << "2.Delete Node at beginning" << endl;
cout << "3.Display Linked List" << endl;
cout << "4.Exit " << endl;
Object Oriented Programming and Data Structures using C++ B20EN0404 Sem:IV P a g e | 32
REVA University School of ECE
switch (choice)
{
case 1:
cout << "Inserting Node at Beginning: " << endl;
lo.insert_begin();
break;
case 2:
cout << "Delete Node at Beginning: " << endl;
lo.delete_begin();
break;
case 3:
cout << "Display elements of link list" << endl;
lo.display();
break;
case 4:
cout << "Exiting..." << endl;
exit(1);
break;
default:
cout << "Wrong choice" << endl;
}
}
}
void SLL::insert_begin()
{
char value;
node *nib = NULL;
nib = new node;
//int i;
if (nib == NULL)
cout << "Memory not allocated";
else
{
cout << "Enter the value to be inserted: ";
cin >> value;
nib->data = value;
Object Oriented Programming and Data Structures using C++ B20EN0404 Sem:IV P a g e | 33
REVA University School of ECE
nib->next = start;
start = nib;
nib = NULL;
}
}
void SLL::delete_begin()
{
char delValue;
node *ndb = NULL;
if (start == NULL)
{
cout << "List is empty" << endl;
return;
}
else
{
ndb = start;
delValue = ndb -> data;
start = ndb -> next;
delete ndb;
void SLL::display()
{
node *ds;
if (start == NULL)
{
cout << "The List is Empty" << endl;
return;
}
else
{
for (ds = start; ds != NULL; ds = ds->next)
{
cout << ds->data << "\t";
}
}
}
Object Oriented Programming and Data Structures using C++ B20EN0404 Sem:IV P a g e | 34
REVA University School of ECE
OUTPUT
---------------------------------
1.Insert Node at beginning
2.Delete Node at beginning
3.Display Linked List
4.Exit
Enter your choice : 3
Display elements of link list
The List is Empty
---------------------------------
Operations on singly linked list
---------------------------------
1.Insert Node at beginning
2.Delete Node at beginning
3.Display Linked List
4.Exit
Enter your choice : 1
Inserting Node at Beginning:
Enter the value to be inserted:
Object Oriented Programming and Data Structures using C++ B20EN0404 Sem:IV P a g e | 35
REVA University School of ECE
10a) Write C++ program to implement Singly Linked List and perform operation adding new
node at the end of Linked List’ & display node values.
10b) Write C++ program to implement Singly Linked List and perform operation deleting a last
node from the Linked List & display node values.
#include<iostream>
using namespace std;
class SLL
{
public:
void insert_begin();
void delete_begin();
void insert_end();
void delete_end();
void display();
};
int main()
{
int choice;
SLL lo;
while (1)
{
cout << endl << "---------------------------------" << endl;
cout << endl << "Operations on singly linked list" << endl;
cout << endl << "---------------------------------" << endl;
cout << "1.Insert Node at End" << endl;
cout << "2.Delete Node at End" << endl;
cout << "3.Display Linked List" << endl;
cout << "4.Exit " << endl;
Object Oriented Programming and Data Structures using C++ B20EN0404 Sem:IV P a g e | 36
REVA University School of ECE
case 2:
cout << "Delete Node at End: " << endl;
lo.delete_end();
break;
case 3:
cout << "Display elements of link list" << endl;
lo.display();
break;
case 4:
cout << "Exiting..." << endl;
exit(1);
break;
default:
cout << "Wrong choice" << endl;
}
}
}
void SLL::insert_end()
{
char insValue;
node *nie, *ck;
nie = new node;
if (nie == NULL)
cout << "Memory not allocated";
else
{
cout << "Enter the value to be inserted: ";
cin >> insValue;
Object Oriented Programming and Data Structures using C++ B20EN0404 Sem:IV P a g e | 37
REVA University School of ECE
nie->data = insValue;
nie->next = NULL;
if (start == NULL)
{
start = nie;
}
else
{
for (ck = start; ck->next != NULL; ck = ck->next)
{}
ck->next = nie;
}
nie = NULL;
ck = NULL;
}
}
void SLL::delete_end()
{
char delValue;
node *nde, *pn;
if (start == NULL)
{
cout << "List is empty" << endl;
return;
}
else if (start->next == NULL) // one node
{
nde = start;
delValue = nde -> data;
start = nde -> next;
delete nde;
}
else
{
for (nde = start; nde->next != NULL; nde = nde->next)
{
pn = nde;
}
pn->next = NULL;
Object Oriented Programming and Data Structures using C++ B20EN0404 Sem:IV P a g e | 38
REVA University School of ECE
void SLL::display()
{
node *ds;
if (start == NULL)
{
cout << "The List is Empty" << endl;
return;
}
else
{
for (ds = start; ds != NULL; ds = ds->next)
{
cout << ds->data << "\t";
}
}
}
OUTPUT:
Operations on singly linked list
---------------------------------
1.Insert Node at End
2.Delete Node at End
3.Display Linked List
4.Exit
Enter your choice : 1
Inserting Node at End:
Enter the value to be inserted: 3
---------------------------------
---------------------------------
1.Insert Node at End
2.Delete Node at End
3.Display Linked List
Object Oriented Programming and Data Structures using C++ B20EN0404 Sem:IV P a g e | 39
REVA University School of ECE
4.Exit
Enter your choice : 2
Delete Node at End:
Element Deleted = 3
---------------------------------
---------------------------------
1.Insert Node at End
2.Delete Node at End
3.Display Linked List
4.Exit
Enter your choice :
Object Oriented Programming and Data Structures using C++ B20EN0404 Sem:IV P a g e | 40
Rukmini Knowledge Park, Kattigenahalli
Yelahanka, Bengaluru - 560 064
Karnataka, India.
Follow us on
/REVAUniversity www.reva.edu.in