diff --git a/C++/Program -1/Program.cpp b/C++/Program -1/Program.cpp new file mode 100644 index 00000000..9144cf64 --- /dev/null +++ b/C++/Program -1/Program.cpp @@ -0,0 +1,23 @@ +#include +using namespace std; +#include +int main() { + cout<<"Enter the number of elements "<>n;//Input the size of array + int arr[n]; + int min=INT_MAX; + int max=INT_MIN; + cout<<"Enter the elements"<>arr[i]; + if(arr[i]max)//if current element is greater than max + max=arr[i];//max is updated + } + cout<<"Minimum element is:"<