I can't find a way to square and cube the number I want, which the number will show in the notepad. Is there a way to cube and square a number in my program??
one way to do something like 73 is using the pow function in the cmath header. try something like this:
1 2 3 4 5 6 7 8 9
#include <cmath> //includes several different functions to do with maths
#include <iostream>
int main()
{
std::cout << pow(7, 3) << std::endl;
return 0;
}
pow works like this: pow(/*base number*/, /*power*/)
Thanks for the info mr. Cronnoc but it doesnt work on my program, anyways this is the problem
"Write a program that reads in a text file named “my_input.txt” that contains characters composed of digits, letters and other symbols. Then it processes the contents of the file by examining each of the characters of the file. If the character read is an alphabet, it checks its case. If it is in lowercase, then its uppercase is sent to a file named “uppercase.txt”; if in uppercase, its lowercase is sent to “lowercase.txt.” But if the character is a symbol, it is sent to “symbols.txt.” Lastly, if it is an integer, it sends its square to a file named “square.txt”, if it is even. Otherwise, it sends its cube to a file named “cube.txt” if it is odd."
Its alright :)) I'm just having a hard time in this problem
"Lastly, if it is an integer, it sends its square to a file named “square.txt”, if it is even. Otherwise, it sends its cube to a file named “cube.txt” if it is odd."