|
From: PETER C. <pca...@cc...> - 2004-06-27 20:35:31
|
hi everyone..freshman cpp needs help again
i want this program to request for any number of integers to be compared for the lowest integer. thanx for your time. peter
#include <iostream>
using namespace std;
int main (){
int num, i, min_so_far;
cout << "How many numbers do you want to compare: ";
cin >> i;
cout << "enter the numbers to be counted: ";
cin >> min_so_far;
for (int i=0; i<min_so_far; i++)
{
cout << "enter number: ";
cin >> num;
if (num < min_so_far)
min_so_far = num;
}
cout << "the minimum is " << min_so_far << endl;
return 0;
}
______________ ______________ ______________ ______________
ccny.cuny.edu
|