Hello everyone. I'm having this problem which I just cannot seem to find the answer to anywhere. I need to declare a variable as a letter or word using an if-else statement. For example, if a numeric value is greater than ten, then I need the variable to be declared as "Yes.", and if the value is less than or equal to ten, I need the variable to be declared as "No.". Unfortunately, I cannot just use "cout <<". Any help would be greatly appreciated!
int Value = 12;
std::string Words;
// You can do this:
Value <= 10 ? Words = "Ten or less" : Words = "More than ten";
// .. or this:
if(Value <= 10) {
Words = "Ten or less";
} else {
Words = "More than ten";
}
// they're both the same.
cout << Words;