The output will be: You owe $ 15.0
If the language is zero indexed:
a[ 33 ]
Answer:
2
Explanation:
The mathematical answer would be 2. To get 11, one would simply put the 1's next to each other but there is an addition symbol. 32 is an irrational number to think of for an answer because there are no other numbers to add or multiply with the 1's to achieve 32. 9 is also irrational for the same reason.
Answer:
#include <iostream>
#include <cstring>
using namespace std;
void replacePeriod(char* phrase) {
int i = 0;
while(*(phrase + i) != '\0')
{
if(*(phrase + i) == '.')
*(phrase + i) = '!';
i++;
}
}
int main() {
const int STRING_SIZE = 50;
char sentence[STRING_SIZE];
strcpy(sentence, "Hello. I'm Miley. Nice to meet you.");
replacePeriod(sentence);
cout << "Updated sentence: " << endl;
cout << sentence << endl;
return 0;
}
Explanation:
- Create a function called replacePeriod that takes a pointer of type char as a parameter.
- Loop through the end of phrase, check if phrase has a period and then replace it with a sign of exclamation.
- Inside the main function, define the sentence and pass it as an argument to the replacePeriod function.
- Finally display the updated sentence.