Advertisement
Guest User

i_hex.cpp a hexadecimal counter 0 to +inf Lauri K. Friberg

a guest
Apr 7th, 2020
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.74 KB | None | 0 0
  1. //This is an infinite counter that displays the integer (whole number)
  2. //series in hexadecimal, starting with 0 and continuing upwards into
  3. //infinity like this: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, a, b, c, d, e, f,
  4. //10, 11, 12, ... The numbers are separated with and endline (endl),
  5. //that can be also denoted with "\n". The program utilizes the iostream
  6. //header file that defines the cout object used, and it utilizes the
  7. //std::hex formatting style to display the hexadecimals.
  8.  
  9. //Hexadecimal counter from 0 upwards towards +infinity.
  10. //Lauri K. Friberg, 2020. i_hex.cpp. A C++ program.
  11.  
  12. #include <iostream>
  13. using namespace std;
  14. int main(void)
  15. {
  16. int i_hex = 0;
  17.  
  18. while(1)
  19. {
  20.     cout << std::hex << i_hex << endl;
  21.     i_hex++;
  22. }
  23.  
  24. return 0;
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement