Skip to main content

Delete Operation

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 in c++

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

       

Comments

Post a Comment

Popular posts from this blog

Object Oriented Programming :

* Object Oriented Programming ::    An OOP (object oriented programming ) is a concepts or programming principle which is used as a latest Programming methodology on which current programming language are based such as--: C++ Java C# Python This programming concept is best suited on which the current software development synory is based. It comprises all expects of software development that are require to developed such software which is perfect accurate and diligent.  The programming approach provide all necessary tool that are needed during development to make software secure smart and expendable. An OOP approach oriented approach which was introduced before the evolution of OOP  concepts procedure . Oriented Language such as C, pascal etc are based on processor oriented programming concept. In procedure programming approach a program is divided into modules or blocks that are know as function or procedure. It was an earlest approach in which ...