Delete Operation in C++ using class:: By A.P... " it is used to remove to a data items In the given collection of data items. " #include "iostream.h" #include"conio.h" Class ap { int arr[100]; public : void get_data(); void del_data(); }; void ap::get_data() { int size, i; ...
Shorting Operation Using Class in c++ ::
#include"iostream.h"
#include"condo.h"
class ap
{
int a [10];
public :
void get_data();
void sort_data();
}
void ap ::get_data()
{
int i;
cout<<endl<<"enter elements ";
for (i=0; i<=10; i++)
{
cin>>a [i];
}
}
void ap::sort_data()
{
int temp;
cout<<endl<<"data before sorting ";
for(int j=0; j<=10; j++)
{
cout<<a [j];
}
for( int i=0; i <=10; i++)
{
for( j=0; j<=10-1; j++)
{
if ( a [j]>a(j+1));
{
temp=a [j];
a[j]=a[j+1];
a[j+1]=temp;
}
}
}
cout <<endl<<"data after sorting";
for( j =0; j<10; j ++)
{
cout<<a[j];
}
}
void main ()
{
clrscr();
ap obj;
obj.get_data();
obj.sort_data();
getch();
}
Output ::::-
enter elements 7890126534
data before sorting 7890126534
Data after sorting 0123456789
Nquicepcont_tsu Samantha Peoples https://marketplace.visualstudio.com/items?itemName=2exliri-a.Descargar-CuberPunk-2090-gratuita-2021
ReplyDeletepcanacakor
namilelre Wewere Tucson
ReplyDeletediotrucuntab