All pastes #939310 Raw Edit

Anonymous

public text v1 · immutable
·published 2008-03-12 05:16 UTC
rendered paste body
#include <iostream>
#include <cstdlib>
#include <cstdio>
#include <limits>
using std::cout;
using std::cin;
using std::endl;
int main (void)
{
    cout << std::numeric_limits<int>::max();
    cin.ignore();
    cin.get();
    unsigned int number = 0;
    while ( number < std::numeric_limits<unsigned int>::max() )
    {
          cout << "Number is: " << number << endl;
          number++;
}

// RETURNS 2147483647


#include <iostream>
#include <cstdlib>
#include <cstdio>
#include <limits>
using std::cout;
using std::cin;
using std::endl;
int main (void)
{
    cout << std::numeric_limits<int>::max();
    cin.ignore();
    cin.get();
    int number = 0;
    while ( number < std::numeric_limits<int>::max() )
    {
          cout << "Number is: " << number << endl;
          number++;
}

// Returns 2147483647