C++ How to Program (10th Edition)
C++ How to Program (10th Edition)
10th Edition
ISBN: 9780134448237
Author: Paul J. Deitel, Harvey Deitel
Publisher: PEARSON
bartleby

Videos

Textbook Question
Book Icon
Chapter 8, Problem 8.14E

(What Does This Code Do?) What does this program do?
1. // EX. 8.14: ex08 14.cpp
2. // What does this program do?
3. #include <iostream>
4. using namespace std;
5.
6. int mystery2(const char*);//prototype
7.
8. int main () {
9. char string1[80];
10.
11. cout <<”Enter a string:";
12. cin >string1;
13. cout << mystery2(string1)<< endl;
14. }
15.
16. // What does this function do?
17. int mystery2 (const char* s) {
18. unsigned int x;
19.
20. for (x = 0; *s != ‘\0’; ++s) {
21. ++x ;
22. }
23.
24. return x;
25. }
Fig. 8.20| What does this program do?

Blurred answer
Students have asked these similar questions
Write the following
Complete the code as below mentioned.  Write all
Functions-   Write a C++ function that takes an integer argument, say n, and prints hello n times.
Knowledge Booster
Background pattern image
Computer Science
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Text book image
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning
Algebraic Expressions – Algebra Basics; Author: TabletClass Math;https://www.youtube.com/watch?v=U-7nq7OG18s;License: Standard YouTube License, CC-BY
Python Tutorial for Beginners 3 - Basic Math, Mathematical Operators and Python Expressions; Author: ProgrammingKnowledge;https://www.youtube.com/watch?v=Os4gZUI1ZlM;License: Standard Youtube License