


Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
The document consists of pseudocode for Bubble Sort and Linear Search in C language.
Typology: Cheat Sheet
1 / 4
This page cannot be seen from the preview
Don't miss anything!



Source Code(c): #include <stdio.h> void main() { int n , i,arr[50],j,temp; printf("Enter the no of the elements:"); scanf("%d",&n); printf("Enter %d elements of array\n",n); for ( i = 0; i < n; i++){ scanf("%d",&arr[i]); } for ( i = 0;i < n; i++){ for ( j = 0; j < n-i-1;j++){ if(arr[j]>arr[j+1]){ temp = arr[j]; arr[j] = arr[j+1]; arr[j+1] = temp;
for ( i = 0;i < n;i++){ printf("%d ",arr[i]); }
if (i == n) printf("Element not found");