Tuesday 8 November 2016

DATA -STRUCTURE (DS) IN C++ BUBBLE SORT PROGRAMMING

CODINGCLASSES|LEARNTOPROGRAM



DATA -STRUCTURE (DS) IN C++  BUBBLE SORT  PROGRAMMING 



#include<iostream.h>
#include<conio.h>
void main()
{
int n,i,j,temp;                                 //intiliaze of variable 
int a[50];
cout<<" Enter the size of  linear array";
cin>>n;
cout<<"Enter the size of an element of an array ";
for(i=0; i<=n;  i++)
{
cin>>a[i];
for(j=0; j<n;  j++)
{
cout<<a[j];
}
for(i=0; i<=n-1; i++ )
}
for(j=0; j<=n-1; j++)
{
if( a[j]> a[j+1])
{                                                       
temp =a[j];                                           //swaping method
a[j]=a[j+1];
a[j+1]=temp;
}
}
}
cout<<"Data after sorting ";
for(j=0; j<n;  j++)
{
cout<<a[j];
}
getch();
}


If you have any doubt plz comment below if you have any question then commnent below or send me mail
thanku for visiting !!

Friday 28 October 2016

DATA-STRUCTURE(DS) PROGRAMMING DELETE AN ELEMENT FROM THE ARRAY

CODINGCLASSES|LEARNTOPROGRAM


                       DATA STRUCTURE


WAP TO DELETE AN ELEMENT FROM THE ARRAY



#include<iostream.h>
#include<conio.h>
void main()
{
int A[100],n,i,loc;
cout<<"Enter the size of an array=  ";
cin>>n;
cout<<"Enter the element of an array ";
for(i=0; i<=n; i++)
{
cin>>A[i];
}
cout<<"Enter the location of element to delete ";
cin>>loc;
if(loc>n)
{
cout<<"The value is out of range ";
}
else
--loc;
for(i=loc; i<=n; i++)
{
A[i]=A[i+1];
}
cout<<"New Array ";
for(i=0; i<n-1; i++)
{
cout<<A[i];
}
getch();
}

OUTPUT:-

                       Enter the size of an array =5
                                                     
                            The element of an array
                                                     2
3
4
7
8
9
Enter the location of element  to delete=4

New array
2
3
7
8
9

HII friends !!this coding is already checked in Turbo c++ Ide
there is no any run and compiled time error ...
keep visiting !!for latest update If you have any request about 
any programming and question   plz comment below or email...







Friday 21 October 2016

DATA STRUCTURE (D S)-INSERT AN ELEMENT IN A LINEAR ARRAY

CODINGCLASSES|LEARNTOPROGRAM

Example of    INSERT AN ELEMENT IN A LINEAR ARRAY


#include<iostream.h>
#incllude<conio.h>
void main()
{
int b[100],n,loc,temp,item;//variable with dattypes
cout<<"Enter the size of an array ";
cin>>n;
cout<<"Enter the elemnet of an array ";
for(int i=0; i<=n; i++)
{
cin>>b[i];
}
cout<<"Enter the position to insert the number ";
cin>>loc;
if(loc>n)
{
cout<<" this the out of range exit";
}
else
{
cout<<" Enter the new items or no";
cin>>item;
for(i=n; i>=loc-1; i--)
{
a[i+1] =a[i];
}
A[loc-1] =item;
cout<<" New element inserted in array";
for(i=0; i<n+1; i++)
{
cout<<a[i];
}
}
getch();
}


o/p-Enter the size 5
Enter the elements
2
3
4
5
6
7
Enter the position no = 2
Enter the new item or no=9
New element inserted in array
2
3
9
4
5
6
7

IN this example no any compile time and no any run time error it is already checked in turbo c++ ide If you want to ask any question plz comment below

KEEP VISITING FOR LATEST UPDATES
TILL THEN KEEP CODING!!

DATA STRUCTURE(D S)-transverse of linear Array

CODINGCLASSES|LEARNTOPROGRAM


Example of transverse of linear Array in data structure(DS)




E.G


#include<iostream.h>
#include<conio.h>
void main()
{
int i,n;
int l[20];
cout<<"Enter the size of an array ";
cin>>n;
cout<<" Enter the element of an given array";
for(i=0; i<=n; i++)
{
cin>>l[i];
}
getch();
}


o/p:-Enter the size = 5
Enter the elements
2,3,4,5,6

INTHIS EXAMPLE NO ANY COMPLIE TIME OR RUN TIME ERROR IT IS ALREADY CHECKED IN TURBO C++ IDE IF YOU HAVE ANY DOUT THEN PLZ COMMNET BELOW AND SEND YOUR FEED BACK THROUGH COMMNET

KEEP  VISITING FOR LATEST UPDATES !!

keep coding!!

Tuesday 11 October 2016

POINTER TO POINTER IN C

CODING CLASSES |LEARN TO PROGRAM

                   POINTER TO POINTER IN C

                                      SYNTAX:-

pointer   :                                            datatype(int) *ptr;

pointer to pointer:                                    datatype  **pptr;

pointer to pointer to pointer:                   datatype  ***ppptr;


pointer to pointer to pointer to pointer      datatype****pppptr;


NOW EXAMPLE OF POINTER TO POINTER HOW TO IMPLEMENTS IN PROGRAMMING 

SIMILAR :-HOW TO START POINTER

E.G:-

#include<stdio.h>
#include<conio.h>
void main()
{
int i;
int *ptr;
int **pptr;
int ***ppptr;

ptr = &i;
pptr=&pt
ppptr=&pptr;
i=30;
}

If you have any problem or have a question plz comment below







POINTER IN C

CODINGCLASSES|LEARNTOPROGRAM



POINTER IN C

                           POINTER
Initialization of Pointer

E.g:-

int a = 20;

int *ptr; //pointer declaration

int =&a ; //pointer intialization and declaring together
 or
int *ptr =&a;

                    keep Coding!!


Sunday 9 October 2016

WHILE LOOP IN C

CODINGCLASSES|LEARNTOPROGRAM


WHILE LOOP IN C

E.G:-


#include<stdio.h>
#include<conio.h>
void main()
{
int i=0,n;
printf("Enter the number from own wish ");
scanf("%d",&n);
while(i<=n)
{
printf("\n ");
i++; 
printf("%d ", &i);
}
getch();
}

o/p:-
Enter the number From own wish
0,1,2,3,4,5,6,7

HII FRIENDS IN THIS PROGRAMMING NO  ANY RUN-TIME AND COMPILE TIME EROR THIS CODE IS ALREADY CHECKED IN    

YOU CAN DOWNLOAD TURBO C/C++ IDE GIVEN BELOW LINK 

IF YOU HAVE ANY QUERY PLZ COMMENT BELOW 

Wednesday 5 October 2016

WHILE LOOP IN C++

CODINGCLASSES|LEARNTOPROGRAM



WHILE LOOP IN C++
E.G:-

#include<iostream.h>
#include<conio.h>
void main()
{
int i=0 ,n;
cout<<"Enter the number from own wish"<<endl;
cin>>n;
while(i<=n)
{
cout<<"This programm is the example of while loop "<<endl;
i++;
cout<<"i"<<endl;
}
getch();
}

o/p:-
Enter the number of own wish n=10
0,1,2,3,4,5,6,7,8,9

Hii, friends in this program no any compile and runtime error it is already checked in Turbo c/c++ ide.

IF you have any query plz comment below

thanks for visiting!!