Show the following output using one loop. 1, 2, 3, 4, 5 6, 7, 8, 9, 10 Try to achieve the result by forcing the next iteration within the loop up
Continue ReadingC++: Langton’s Ant
Langton's ant is a cellular automaton that models an ant sitting on a plane of cells, all of which are white initially, facing in one of four directio
Continue ReadingC++: Greyscale Bars
The task is to display a series of vertical greyscale bars (contrast bars) with a sufficient number of bars to span the entire width of the display.
Continue ReadingC++: Exceptions
This task is to give an example of an exception handling routine and to "throw" a new exception. C++ has no finally construct. Instead you can do t
Continue ReadingC++: Environment Variables
Show how to get one of your process's environment variables. The available variables vary by system; some of the common ones available on Unix include
Continue ReadingC++: Date Format
Display the current date in the formats of "2007-11-10" and "Sunday, November 10, 2007". // Display the current date in the formats of "2007-11-1
Continue ReadingC++: Count in Factors
Write a program which counts up from 1, displaying each number as the multiplication of its prime factors. For the purpose of this task, 1 may be show
Continue ReadingC++: For Loop
“For” loops are used to make some block of code be iterated a number of times, setting a variable or parameter to a monotonically increasing integ
Continue ReadingC++: Identity Matrix
Build an identity matrix of a size known at runtime. An identity matrix is a square matrix, of size n × n, where the diagonal elements are all 1s,
Continue ReadingC++: Standard Error
A common practice in computing is to send error messages to a different output stream than normal text console messages. The normal messages print
Continue Reading




