#include<stdio.h>
const unsigned int rows = 10;
const unsigned int cols = 3;
int table[rows][cols];
int square (const int n) {
return n * n;
}
int cube (const int n) {
return n * n * n;
}
void initialise_table (void) {
int x, y, val;
for (x=0; x<rows; ++x) {
val = x+1;
table[x][0] = val;
table[x][1] = square (val);
table[x][2] = cube (val);
}
}
int main (void) {
int x, y;
initialise_table ();
printf ("Value\tSquare\tCube\n");
for (x=0; x<rows; ++x) {
printf("%d\t%d\t%d\n", table[x][0], table[x][1], table[x][2]);
}
return 0;
}
If you include fractions and decimals, then there are an infinite number of squares and cubes in any range. If you consider only whole numbers, then from 1 to 20: Squares: 1, 4, 9, and 16. Cubes: 1 and 8.
Yes. In fact, they are integers.
All non-negative numbers (including zero) are real-number squares of other numbers.All numbers (positive, negative, and zero) are cubes of other numbers."Numbers" generally refers to the set of all real numbers. 2 is the square of a real number, √2. √2 is not a whole number. It's not even rational. But it is a real number, and therefore meets the criteria specified. Even pi (π), an irrational number itself, is the square of another real number (√π). The only real numbers that cannot be squares are negative numbers, because squares of negative numbers are always positive, because the product of two negative numbers is always positive. This restriction, however, does not apply to cubes, because if you multiply three negative numbers by each other, the result is negative.Now, for the question you may have meant to ask: "What numbers are squares and cubes of whole numbers (integers)?"It would be impossible to list all squares and cubes of integers, because even when you limit it to integers, there is still an infinite number of numbers, and every one of them has both a square and a cube.Examples of integers, their squares, and their cubes.0, 0, 01, 1, 1(-1, 1, -1)2, 4, 8,(-2, 4, -8)3, 9, 274, 16, 645, 25, 12510, 100, 1000Only a very few numbers, such as 0, 1, and 64, are both squares and cubes of integers. Note that 64 is 43 and also 82. (see the related question)
Answer: 1, 64, & 729
Cubes have a square on each side, but rectangular prisms have rectangles or squares.
Cubes of squares or squares of cubes, like 1, 64 and 729.
If you include fractions and decimals, then there are an infinite number of squares and cubes in any range. If you consider only whole numbers, then from 1 to 20: Squares: 1, 4, 9, and 16. Cubes: 1 and 8.
Yes. In fact, they are integers.
Not necessarily. The cube of sqrt(2) is not rational.
The sum of their squares is 10.
There are 12 squares on 2 cubes
All non-negative numbers (including zero) are real-number squares of other numbers.All numbers (positive, negative, and zero) are cubes of other numbers."Numbers" generally refers to the set of all real numbers. 2 is the square of a real number, √2. √2 is not a whole number. It's not even rational. But it is a real number, and therefore meets the criteria specified. Even pi (π), an irrational number itself, is the square of another real number (√π). The only real numbers that cannot be squares are negative numbers, because squares of negative numbers are always positive, because the product of two negative numbers is always positive. This restriction, however, does not apply to cubes, because if you multiply three negative numbers by each other, the result is negative.Now, for the question you may have meant to ask: "What numbers are squares and cubes of whole numbers (integers)?"It would be impossible to list all squares and cubes of integers, because even when you limit it to integers, there is still an infinite number of numbers, and every one of them has both a square and a cube.Examples of integers, their squares, and their cubes.0, 0, 01, 1, 1(-1, 1, -1)2, 4, 8,(-2, 4, -8)3, 9, 274, 16, 645, 25, 12510, 100, 1000Only a very few numbers, such as 0, 1, and 64, are both squares and cubes of integers. Note that 64 is 43 and also 82. (see the related question)
Squares are 2D figures and cubes are 3D figures Also squares are the faces of a cube
Answer: 1, 64, & 729
8 and 9
64 is the square of 8 and the cube of 4.
This is a little odd, but: All squares are rectangles, but rectangles are never squares.