L
lopez
Hi,
I tried running the following program using cygwin.
/** @file list0201.cpp */
/** Listing 2-1. Reading Test */
/// Read the program and determine what the program does.
#include <iostream>
#include <istream>
#include <limits>
#include <ostream>
int main()
{
int min(std::numeric_limits<int>::max());
int max(std::numeric_limits<int>::min());
bool any(false);
int x;
while (std::cin >> x)
{
any = true;
if (x < min)
min = x;
if (x > max)
max = x;
}
if (x)
std::cout << "min = " << min << "\nmax = " << max << '\n';
}
the command I used is
g++ list0201.cpp -o list0201 //to compile
and
../list0201 //to run
When I run I am getting a blank screen which does not seem to
terminate .. Can someone help me
I tried running the following program using cygwin.
/** @file list0201.cpp */
/** Listing 2-1. Reading Test */
/// Read the program and determine what the program does.
#include <iostream>
#include <istream>
#include <limits>
#include <ostream>
int main()
{
int min(std::numeric_limits<int>::max());
int max(std::numeric_limits<int>::min());
bool any(false);
int x;
while (std::cin >> x)
{
any = true;
if (x < min)
min = x;
if (x > max)
max = x;
}
if (x)
std::cout << "min = " << min << "\nmax = " << max << '\n';
}
the command I used is
g++ list0201.cpp -o list0201 //to compile
and
../list0201 //to run
When I run I am getting a blank screen which does not seem to
terminate .. Can someone help me