Write a C++ program that inputs a series of 20 numbers and display minimum value.
Solution :
#include <iostream.h>
#include <conio.h>
int main ()
{
int Min;
int Counter;
int value;
cout<< "Enter the number: " ;
cin>> Min;
for (Counter = 0; Counter < 19; Counter++)
{
cout<<"Enter a Number; ";
cin>> value;
if (value < Min)
Min = value;
}
cout<<"Minimum value is : " <<Min <<endl;
getch();
return 0;
return 0;
}
why you have used counter value?
ReplyDeleteto count each iteration of loop.
Deleteour professor says this program is not right and is proxy
ReplyDeletethis code is 100% accurate.
Deletecan u please write this program to switch statement?
ReplyDelete