Write a program to find the minimum number in a list of given N integers.
Input format
First line contain number of integer N.
Second line contains Nnumbers separated by single space.
Output format
Print the minimum number in the N given integers.
Input Constraints
1<N<10
I sai < 100
Sample input 1
Copy
Sample output 1
3
1
5 1 4
Answers
Answered by
17
In C++:
#include <bits/stdc++.h>
using namespace std;
int main()
{
int n;cin>>n;
int arr[n];
//Inputing the Values into the arrays
for(int i = 0;i<n;i++)
{
cin>>arr[i];
}
//using the library function called min( )
int res = arr[0];
for(int i = 1;i < n;i++)
{
res = min(res,arr[i]);
}
cout<<res<<endl;
}
Note:
It generate the minimum number from a list of numbers
Answered by
0
Answer:
print answer at once time give answer
Similar questions
Math,
1 month ago
Math,
1 month ago
Geography,
2 months ago
English,
2 months ago
World Languages,
10 months ago
English,
10 months ago
Computer Science,
10 months ago