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

File Uploading in PHP

  File Uploading in PHP PHP allow you to upload any type of a file i.e. image, binary or text files.etc..,PHP has one in built global variab...