#include <iostream>
using namespace std;
void insertionSort(int *arr,int n){
int i, temp, j;
for (i = 1; i < n; i++)
{
temp = arr[i];
j = i-1;
while (j >= 0 && arr[j] > temp)
{
arr[j+1] = arr[j];
j = j-1;
}
arr[j+1] = temp;
}
}
int main()
{
int arr[5],counter=0;
for(int i=0;i<5;i++){
cout<<"Enter a Number : ";
cin>>arr[i];
counter++;
insertionSort(arr,counter);
for(int j=0;j<counter;j++){
cout<<arr[j]<<" ";
}
cout<<endl;
}
return 0;
}
During the last decade, hybrid electric vehicles have come on the market and new technique...
A self-driving car can analyze surrounding without any human interactions and take decisio...
Augmented Reality (AR) driven mobile application for client?s footwear store. This footwea...
Our team has been researching a more efficient solution for the inspection of their power...
Automatic synchronizers are widely employed to connect more than one synchronous generator...