Professional Documents
Culture Documents
DAAOA Lab 1
Code:
//Name - Ruturaj nitin uttarwar
//Roll no. ET-D3_60
//Title:Insertion Sort of integers
//Description: the below c program is built to sort n elements in
array in ascending form
//input: n elements of array in unsorted form
//output: sorted array
#include<stdio.h>
int main()
{
int a[100],n,i,j,t,temp;
printf("Number of elements\n");
scanf("%d",&n);
printf("Enter %d integer\n",n);
for(i=0;i<n;i++)
{
scanf("%d",&a[i]);
}
for(i=1;i<n;i++)
{
t=i;
j=t-1;
Name: Ruturaj Uttarwar Class: TY ET-D
GR No: 12020036 Roll No: 60
printf("Sorted list:\n");
for(i=0;i<n;i++)
{
printf("%d\n",a[i]);
}
Output:
Name: Ruturaj Uttarwar Class: TY ET-D
GR No: 12020036 Roll No: 60
Code:
//Name - Ruturaj nitin uttarwar
//Roll no. ET-D3_60
//Title:Bubble Sort of integers
//Description: the below c program is built to sort n elements in
array in ascending form
//input: n elements of array in unsorted form
//output: sorted array
int main()
{
int n, c, d, swap; //Introducing the required variable
return 0;
}
Output:
Name: Ruturaj Uttarwar Class: TY ET-D
GR No: 12020036 Roll No: 60