SlideShare a Scribd company logo
PROGRAM 17
AIM: To create a menu driven program to insert & delete an element in a sorted array
SOLUTION:
#include<iostream.h>
#include<conio.h>
void initialize(int a[],int s);
void display(int a[],int s);
void insert(int a[],int &m);
void del(int a[],int &siz);
void main()
{
int ch,arr[70],size=0;
char p;
do
{
clrscr();
cout<<"||PROGRAM TO INSERT AND DELETE AN ELEMENT IN A SORTED 1D
ARRAY||";
cout<<"nn MENU:";
cout<<"n1.INITIALISE ARRAYn2.DISPLAY ARRAYn3.INSERT AN ELEMENT";
cout<<"n4.DELETE AN ELEMENT";
cout<<"nnEnter your choice ";
cin>>ch;
switch(ch)
{
case 1:
{
cout<<"Enter the size of array ";
cin>>size;
cout<<"nn##Initialise in ascending order##n";
initialize(arr,size);
}
break;
case 2:
display(arr,size);
break;
case 3:
insert(arr,size);
break;
case 4:
del(arr,size);
break;
}
cout<<"nTo go back to menu press y:
New microsoft word document

More Related Content

DOCX
One dimensional operation of Array in C- language
DOCX
basic programs in C++
PDF
Program in ‘C’ language to implement linear search using pointers
PDF
Bcsl 033 data and file structures lab s5-2
PDF
Insertion sort
PDF
Implement a queue using two stacks.
PDF
Bcsl 033 data and file structures lab s5-3
One dimensional operation of Array in C- language
basic programs in C++
Program in ‘C’ language to implement linear search using pointers
Bcsl 033 data and file structures lab s5-2
Insertion sort
Implement a queue using two stacks.
Bcsl 033 data and file structures lab s5-3

What's hot (19)

DOCX
PROGRAM FOR INSERTION SORTING IN ARRAY
DOC
Ffffffffffff
PDF
C언어 스터디 강의자료 - 1차시
DOCX
Array imp of list
DOCX
Document
PPTX
Python basic Program
PPTX
Structure
PDF
PPT
StackArray stack3
DOCX
array implementation
PPTX
C & Python Introduction
TXT
Data Structures : array operations in c program
PDF
Programa en java circulos
PPTX
DS- Stack ADT
DOCX
Circular queue
KEY
Ruby haskell extension
PDF
A story about my journey in the land of programming practices
PROGRAM FOR INSERTION SORTING IN ARRAY
Ffffffffffff
C언어 스터디 강의자료 - 1차시
Array imp of list
Document
Python basic Program
Structure
StackArray stack3
array implementation
C & Python Introduction
Data Structures : array operations in c program
Programa en java circulos
DS- Stack ADT
Circular queue
Ruby haskell extension
A story about my journey in the land of programming practices
Ad

Similar to New microsoft word document (20)

DOCX
C++ file
DOCX
C++ file
PDF
54602399 c-examples-51-to-108-programe-ee01083101
PDF
C Programming Example
DOC
CBSE Class XII Comp sc practical file
DOCX
Cs pritical file
DOCX
C++ 4
PDF
Computer_Practicals-file.doc.pdf
DOCX
12th CBSE Practical File
PDF
Common problems solving using c
DOCX
DAA Lab File C Programs
DOCX
Assignement of programming & problem solving ass.(3)
DOCX
B.Com 1year Lab programs
DOCX
OOP program questions with answers
DOCX
Chapter 8 c solution
PDF
C programs Set 2
DOCX
SaraPIC
DOCX
C++ assignment
DOCX
Pratik Bakane C++
C++ file
C++ file
54602399 c-examples-51-to-108-programe-ee01083101
C Programming Example
CBSE Class XII Comp sc practical file
Cs pritical file
C++ 4
Computer_Practicals-file.doc.pdf
12th CBSE Practical File
Common problems solving using c
DAA Lab File C Programs
Assignement of programming & problem solving ass.(3)
B.Com 1year Lab programs
OOP program questions with answers
Chapter 8 c solution
C programs Set 2
SaraPIC
C++ assignment
Pratik Bakane C++
Ad

Recently uploaded (20)

PPTX
IMPACT OF LANDSLIDE.....................
PDF
Data Engineering Interview Questions & Answers Cloud Data Stacks (AWS, Azure,...
PPTX
01_intro xxxxxxxxxxfffffffffffaaaaaaaaaaafg
PPTX
Copy of 16 Timeline & Flowchart Templates – HubSpot.pptx
PDF
Capcut Pro Crack For PC Latest Version {Fully Unlocked 2025}
PDF
168300704-gasification-ppt.pdfhghhhsjsjhsuxush
PPTX
Topic 5 Presentation 5 Lesson 5 Corporate Fin
PPTX
Qualitative Qantitative and Mixed Methods.pptx
PDF
annual-report-2024-2025 original latest.
PPTX
importance of Data-Visualization-in-Data-Science. for mba studnts
PPTX
Managing Community Partner Relationships
PPT
Predictive modeling basics in data cleaning process
DOCX
Factor Analysis Word Document Presentation
PDF
Transcultural that can help you someday.
PDF
Introduction to the R Programming Language
PDF
REAL ILLUMINATI AGENT IN KAMPALA UGANDA CALL ON+256765750853/0705037305
PPTX
modul_python (1).pptx for professional and student
PPTX
Acceptance and paychological effects of mandatory extra coach I classes.pptx
PDF
Microsoft Core Cloud Services powerpoint
PPTX
Leprosy and NLEP programme community medicine
IMPACT OF LANDSLIDE.....................
Data Engineering Interview Questions & Answers Cloud Data Stacks (AWS, Azure,...
01_intro xxxxxxxxxxfffffffffffaaaaaaaaaaafg
Copy of 16 Timeline & Flowchart Templates – HubSpot.pptx
Capcut Pro Crack For PC Latest Version {Fully Unlocked 2025}
168300704-gasification-ppt.pdfhghhhsjsjhsuxush
Topic 5 Presentation 5 Lesson 5 Corporate Fin
Qualitative Qantitative and Mixed Methods.pptx
annual-report-2024-2025 original latest.
importance of Data-Visualization-in-Data-Science. for mba studnts
Managing Community Partner Relationships
Predictive modeling basics in data cleaning process
Factor Analysis Word Document Presentation
Transcultural that can help you someday.
Introduction to the R Programming Language
REAL ILLUMINATI AGENT IN KAMPALA UGANDA CALL ON+256765750853/0705037305
modul_python (1).pptx for professional and student
Acceptance and paychological effects of mandatory extra coach I classes.pptx
Microsoft Core Cloud Services powerpoint
Leprosy and NLEP programme community medicine

New microsoft word document

  • 1. PROGRAM 17 AIM: To create a menu driven program to insert & delete an element in a sorted array SOLUTION: #include<iostream.h> #include<conio.h> void initialize(int a[],int s); void display(int a[],int s); void insert(int a[],int &m); void del(int a[],int &siz); void main() { int ch,arr[70],size=0; char p; do { clrscr(); cout<<"||PROGRAM TO INSERT AND DELETE AN ELEMENT IN A SORTED 1D ARRAY||"; cout<<"nn MENU:"; cout<<"n1.INITIALISE ARRAYn2.DISPLAY ARRAYn3.INSERT AN ELEMENT"; cout<<"n4.DELETE AN ELEMENT"; cout<<"nnEnter your choice "; cin>>ch; switch(ch) { case 1: { cout<<"Enter the size of array "; cin>>size; cout<<"nn##Initialise in ascending order##n"; initialize(arr,size); } break; case 2: display(arr,size); break; case 3: insert(arr,size); break; case 4: del(arr,size); break; } cout<<"nTo go back to menu press y: