2. Write a C++ program that given any letter (uppercase or lowercase) it will display the same letter as lowercase.
How am I supposted to do this program? For example, if I enter A, it enters a. But if I enter b, it enters b. (always show the lowercase letter)
3. Cutting a cube
Is it possible to cut a large cube with side 13 into 2012 smaller cubes with
sides 1, 2 or 3 units?
These seem awfully homework-y, so excuse me for being a bit vague with the responses.
1) Think about the statements. What happens when you divide a float and the result is not a whole number? What happens if you do the same for an integer?
Take a look at the output for this:
1 2 3 4 5 6 7 8 9
#include <iostream>
int main( int argc, char* argv[] )
{
int num = 45;
std::cout << "Float: " << ( float( num ) / 2 ) << std::endl;
std::cout << "Int : " << num / 2 << std::endl;
return 0;
}