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