diff --git a/Bubblesort.cpp b/Bubblesort.cpp new file mode 100644 index 0000000..f2b361d --- /dev/null +++ b/Bubblesort.cpp @@ -0,0 +1,35 @@ +#include + +using namespace std; + +int main() +{ int n=0,i=0,max=0; + cout<<"\t\tProgram on Bubble sort"; + cout<<"\nEnter the size of array : ";cin>>n; + int a[n]; + cout<<"Enter the array elements :\n"; + for(i=0;i>a[i];} + int j=0; + max=0; + for(i=0;ia[j+1]) + { + max=a[j]; + a[j]=a[j+1]; + a[j+1]=max; + }} + } + + } + cout<<"Sorted Element are :"; + for(i=0;i + +using namespace std; + +int main() +{ int n=0,i=0,num=0,max=0,pos=0; + cout<<"\t\tProgram on Linear Search"; + cout<<"\nEnter the size of array : ";cin>>n; + int a[n]; + cout<<"Enter the array elements :\n"; + for(i=0;i>a[i];} + cout<<"Enter the search elemnet :";cin>>num; + max=0; + for(i=0;i