Computer Science, asked by arjunharipad2003, 1 year ago

write a c++ programe to input 10 integer numbers into an array and ditermine the maximum and minimum value amoung them​

Answers

Answered by theajitkamble007
0

Answer:

PROGRAMM

Explanation:

#include<iostream.h>

#include<conio.h>

void main()

{

clrscr();

int arr[10] , n, i, max, min;

cout<<"enter the size of the array : ";

cin>>n ;

cout << "Enter the elements of the array : "; for (i = 0; i < n; i++)

cin >> arr[ i ] ;

max = arr[ 0 ];

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

{

if (max < arr[i])

max = arr[i];

}

min = arr[0];

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

{

if (min > arr[i])

min = arr[i];

}

cout << "Largest element : " << max;

cout << "Smallest element : " << min;

return 0;

}

Similar questions