## Write a program to sort elements of given array having ‘n’ numbers of element, using Selection sort.

Write a program to sort elements of given array having ‘n’ numbers of elements, using Selection sort. #include #include void main() { clrscr(); int size, arr, i, j, temp; cout<>size;…

## Write a program to generate Fibonacci series with the help of recursion.

#include #include int recfib(int n) { if(n==1) { return 0; } else if(n<3) { return 1; } else { return(recfib(n-1)+recfib(n-2)); } } void main() { clrscr(); int n; cout<<"n Fibonacci…

## Write a program to implement the concept of pointer to array access in functions.

#include #include main() { int *p,i,n; void modify(int *,int); clrscr(); cout<>n; for(i=0;i<n;i++) { cout<<"n A["<<i<>*(p+i); } cout<<"nnn"; cout<<"n Before calling the function for modification elements are :n"; for(i=0;i<n;i++) { cout<<"n…

## /Wrtite a program to sort elements of given array having ‘n’ numbers of elements, using Insertion sort

#include #include main() { int a; int i,n,temp,j,k; clrscr(); cout<>n; cout<<"enter array :" ; for(i=0;i>a[i]; } for(i=1;i=0 && a[j]>temp) { a[j+1]=a[j]; j--; } a[j+1]=temp; } for(i=0;i<n;i++) { cout<<a[i]; } getch();…

## Write a program to search an element of choice from the array having ‘n’ number of element, using Linear Search.

#include #include main() { int a,i,n,search; cout<>n; cout<<"n enter elements :"; for(i=0;i>a[i]; } cout<>seacrh; for(i=0;i<n;i++) { if(a[i]==search) { cout<<"n found at location :"<<i+1; } else { cout<<"n not found :";…

## Write a program to sort elements of given array having ‘n’ number of elements,using Merge Sort.

#include #include main() { int a,c,n,i; void merge(int *,int,int); void mr(int*,int,int,int,int); clrscr(); cout<>n; cout<<"n Enter the elements of array n"; for(i=0;i<n;i++) { cout<<"n a["<<i<>a[i]; } merge(a,0,n-1); cout<<"nnn MERGED ARRAY IN…