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
Hindi,
10 hours ago
Political Science,
10 hours ago
English,
10 hours ago
Geography,
19 hours ago
English,
19 hours ago
World Languages,
7 months ago
English,
7 months ago
Computer Science,
7 months ago