Sunday, September 11, 2022

Find maximum integer

 // Find maximum integer

#include <iostream>

using namespace std;

int

main ()

{

  int max_int = 1, b = 1;

  do

    { max_int = b;  b = max_int + 1;}

  while (b > max_int);

  cout << "Maximum integer=" << max_int << ", b=" << b;

  return 0;

}

No comments:

Post a Comment

Basic Comparison of C++ and HTML/JavaScript

 Here’s a basic comparison of C++ and HTML/JavaScript for common programming concepts and  simple code examples for each. This will help ...