POP Lab Programs With Output
POP Lab Programs With Output
Output:
Output:
Output:
printf("\n");
}
getch();
}
Output:
Output:
Enter the angle
45
Sin (45.000000) using taylor series=0.707320
Using inbuilt func on sin(45.000000)=0.707320
8. Sort the given set of N numbers using Bubble sort.
#include<stdio.h>
#include<conio.h>
void main()
{
int i,j,n,temp;
int a[20];
clrscr();
printf("enter the value of n");
scanf("%d",&n);
printf("Enter the numbers in unsorted order:\n");
for(i=0;i<n;i++)
scanf("%d", &a[i]);
// bubble sort logic
for(i=0;i<n;i++)
{
for(j=0;j<(n-i)-1;j++)
{
if( a[j]>a[j+1])
{
temp=a[j];
a[j]=a[j+1];
a[j+1]=temp;
}
}
}
printf("The sorted array is\n");
for(i=0;i<n;i++)
{
printf("%d\n",a[i]);
}
getch();
}
Output:
Output:
Enter USN=3BR22DS300
Enter Name=BITM
Enter the three subject score
87 67 75
Enter the detail of 2 students
Enter USN=3BR22DS301
Enter Name=DATASCIENCE
Enter the three subject score
67 98 58
Enter the detail of 3 students
Enter USN=3BR22DS303
Enter Name=DUMMY
Enter the three subject score
35 25 29
Output:
Output: