#include<stdio.h>
#include<conio.h>
void input(int arr[],int);
void display(int arr[],int);
void bubblesort(int arr[],int n);
void main()
{
int arr[10],n;
clrscr();
printf("Enter size of array=");
scanf("%d",&n);
input(arr,n);
display(arr,n);
printf("\nAfter arranging the array is=");
bubblesort(arr,n);
display(arr,n);
getch();
}
void input(int arr[],int n)
{
int i;
for(i=0;i<n;i++)
{
printf("\nEnter element=");
scanf("%d",&arr[i]);
}
}
void display(int arr[],int n)
{
int i;
printf("\nThe array is=");
for(i=0;i<n;i++)
{
printf("\n%d",arr[i]);
}
}
void bubblesort(int arr[],int n)
{
int temp,j,i;
for(i=0;i<n-1;i++)
{
for(j=0;j<(n-1-j);j++)
{
if(arr[j]>arr[j+1])
{
temp=arr[j];
arr[j]=arr[j+1];
arr[j+1]=temp;
}
}
}
}

PROVIDE THE ON DEMAND PROJECTS EITHER THEY ARE DOMESTIC, COLLEGE PROJECTS, OR COMMERCIAL PROJECTS. YOU WILL GET THE PROJECT COMPLETELY ACCORDING TO YOUR REQUIREMENTS. CONTACT US AT :- knowledgeforyou2022@gmail.com

Leave a Reply

Your email address will not be published.