C++ program to generate Collatz Conjecture sequence.

```// ? 2017 TheFlyingKeyboard and released under MIT License
// theflyingkeyboard.net

#include <iostream>

using namespace std;

unsigned long long collatzConjecture(unsigned long long num);

int main(){
unsigned long long number;
unsigned long long iterNum = 0;

cout << "Enter a number: ";
cin >> number;

cout << number << " ";

while(number != 1){
number = collatzConjecture(number);
cout << number << " ";

iterNum++;
}

cout << endl << "It took " << iterNum << " iterations to reach 1" << endl;

return 0;
}

unsigned long long collatzConjecture(unsigned long long num){
if(num % 2 == 0){
return num / 2;
}else{
return 3 * num + 1;
}
}```

C++ Collatz Conjecture Sequence Generator
Tagged on:
{"ft_lang_label":"__label__en","ft_lang_prob":0.5343237,"math_prob":0.9910293,"size":724,"snap":"2021-31-2021-39","text_gpt3_token_len":191,"char_repetition_ratio":0.19027779,"word_repetition_ratio":0.06837607,"special_character_ratio":0.31491712,"punctuation_ratio":0.16814159,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.98440665,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2021-09-16T22:58:44Z\",\"WARC-Record-ID\":\"<urn:uuid:691871ed-b9ab-40a8-acb7-66c3434fb9bd>\",\"Content-Length\":\"57325\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:29e140a5-8936-4795-ad09-2d606a034bf4>\",\"WARC-Concurrent-To\":\"<urn:uuid:8083a8d7-b849-45c5-b67a-7909a0434c5d>\",\"WARC-IP-Address\":\"195.78.66.97\",\"WARC-Target-URI\":\"http://theflyingkeyboard.net/c/c-collatz-conjecture-sequence-generator/\",\"WARC-Payload-Digest\":\"sha1:LLHBNEQOEHJTHYYB64XQLZRG2BGFHULQ\",\"WARC-Block-Digest\":\"sha1:7RHZLDTD5DH3WQA7D5Y7O3OQXCBXUR3I\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2021/CC-MAIN-2021-39/CC-MAIN-2021-39_segments_1631780053759.24_warc_CC-MAIN-20210916204111-20210916234111-00711.warc.gz\"}"}