Find Smallest And Largest Number

in Hindi - Find Smallest And Largest Number



not yet

Source Code :

RUN#include <iostream>
#include <stdio.h>
using namespace std;

int main ()
{
int num[5], i, j, max, min;

cout<<"Please enter 5 numbers\n";
for (i = 0; i < 5; i++)
{
cin>>num[i];
}
max = num[0];
min = num[0];
for (i = 0; i < 5; i++)
{
if (num[i] < min)
{
min = num[i];
}
else if (num[i] > max)
{
max = num[i];
}
}
cout<<"Small number = "<<min<<endl;
cout<<"Large number = "<<max;

return 0;
}