Friday 24 June 2016

C++ Program - Largest Number in an Array

#include
#include
#include
using namespace std;
int main() {
int i,j,temp,arrSize;
cout<<"Enter Array Size.:";
cin>>arrSize;
int a[arrSize];
cout<<"Enter Any"< for(i=0;i cin>>a[i];
}
for(i=0;i for(j=i+1;j if(a[j] < a[i]) {
temp = a[j];
a[j] = a[i];
a[i] = temp;
}
}
}
cout<<"Largest No. is "< return 0;
}

No comments:

Post a Comment

CakePHP Date Picker

Folder Structure: Controller:   File location - cakephp/src/controller/HomepageController.php namespace App\Controller; use...