Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
4003CEM-intro_orig/lab_answer.cpp
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
24 lines (21 sloc)
717 Bytes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
/** | |
* @brief Identify if the given value is 42. | |
* | |
* The ultimate answer to life, the universe, and everything is 42. | |
* Read "The Hitchhiker's Guide to the Galaxy" by Douglas Adams | |
* if you are confused by my sense of humour. | |
* | |
* @param value The value to check. | |
* @return true If the value is 42. | |
* @return false If the value is not 42. | |
*/ | |
// IS_ULTIMATE_ANSWER FUNCTION | |
int main() | |
{ | |
/* By using std::boolalpha here I can get std::cout to print "true" | |
and "false" for booleans instead of just 1 and 0. */ | |
std::cout << std::boolalpha << is_ultimate_answer( 42 ) << std::endl; | |
std::cout << std::boolalpha << is_ultimate_answer( 535 ) << std::endl; | |
return 0; | |
} |