NPTEL Programming in Modern C++ Week 1 : Programming Assignment 3

 #include <iostream>

#include <algorithm>

using namespace std;


void getSorted(int arr[], int n)

{

 int i,j,temp;

 for(i=0;i<n-1;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;

     }

   }

 }

 


}


void find_and_update(int arr[], int n, int x, int y)

{

       int i;


      for(i=0;i<n;i++)

      {

        if(arr[i]==x)

        {

          arr[i]=y;

        }

      }


}

No comments

JavaFX Scene Builder

  This is an article about the JavaFX Scene Builder. You will get a short introduction about the installation and usage of the software. The...