Python:
sentence = “this is the sentence.”
size = len(sentence)
C++:
string sentence = “this is the sentence.”
int size = sentence.size()
* Remember strings are just arrays of characters.
Answer:
D. Algorithms of simple problems are readily available for reference.
Explanation:
Hope this helps you! Ask me anything if you have any quistions!
Answer:
function countWords(sentence) {
return sentence.match(/\S+/g).length;
}
const sentence = 'This sentence has five words ';
console.log(`"${sentence}" has ${countWords(sentence)} words` );
Explanation:
Regular expressions are a powerful way to tackle this. One obvious cornercase is that multiple spaces could occur. The regex doesn't care.
Answer: Basic Combined Programming Language
Explanation: it is a procedural, imperative, and structured programming language, originally intended for writing compilers for other languages.