Home

Awesome

correct_cpp_is_even

BranchTravis CICodecov
masterBuild Statuscodecov.io

Correct C++ chapter 'is even'.

Goals

Prerequisites

Exercise

Write a command-line interface (CLI) program that determines if its argument is an even number.

If there are more arguments supplied, exit the program.

Call to is_evenOutputExit status
./is_evenAny1
./is_even 12345678901234567890true (with newline)0
./is_even 12345678901234567891false (with newline)0
./is_even nonsenseAny1
./is_even 2 1Any1

This is the code you start with:

main(argc, argv)
{
  //Your code here
}

External links