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 4, Problem 4.12E

(What Does this Program Do?) What does the following program print?
1. // Exercises 4.12: Mystery.cpp
2. #include <iostream>
3. using namespace std;
4.
5. int main () {
6. unsigned int x {1};
7. unsigned int total {0};
8.
9. while (x <= 10) {
10. int y = x * x;
11. cout << y<< end1;
12. total += y;
13. ++x;
14. }
15.
16. cout << “Total is ”<< total << end1;
17. }

Blurred answer
Students have asked these similar questions
1) #include #include int power(int, int); int main(void) { int x, n; printf("Enter a number and powerto raise it to: "); scanf_s("%d %d", &x, &n); printf("Result: %d\n", power(n, x)); return 0; } int power(int x, int n) { int m; if (n == 0) return 1; if (n % 2 == 0) { m = power(x, n / 2); return m * m; } else return x * power(x, n - 1); } 2) #include int hcf(int n1, int n2); int main() { int n1, n2; printf("Enter any two positive integers: "); scanf("%d %d", &n1, &n2); printf("Greatest Common Divisor of %d and %d is %d.", n1, n2, hcf(n1,n2)); return 0; } int hcf(int n1, int n2) { if (n2 != 0) return hcf(n2, n1%n2); else return n1; } 3) #include int main() { int array[], minimum, size, c, location = 1; printf("Enter the number of elements in array\n"); scanf("%d",&size); printf("Enter %d integers\n", size); for ( c = 0 ; c < size ; c++ ) scanf("%d", &array[c]); minimum = array[0]; for ( c = 1 ; c < size ; c++ ) { if ( array[c] < minimum ) {…
Q8(JAVA)
(write a pseudocode or draw a flowchart of the given program below) #include<iostream>#include<string.h>using namespace std; class staff{public:string Name;char NoIC[13];int Age;int Category;int Scheme;}; int main(){int n=2;staff s[n];for(int i=0;i<n;i++){cout<<"Enter Name ";cin>>s[i].Name;cout<<"Enter Number Ic ";cin>>s[i].NoIC;cout<<"Enter Age ";cin>>s[i].Age;cout<<"Enter Category(1 for Academic / 2 for Non-Academic) ";cin>>s[i].Category;cout<<"Enter Scheme (1 for Pension on 56 years / 2 for Pension on 60 years) ";cin>>s[i].Scheme;}cout<<endl;cout<<"Staff's Information"<<endl;cout<<"Name\t\tNoIC\t\tAge\tCategory\tScheme"<<endl;for(int i=0;i<n;i++){cout<<s[i].Name<<"\t\t";cout<<s[i].NoIC<<"\t";cout<<s[i].Age<<"\t";if(s[i].Category==1)cout<<"Academic"<<"\t";else…

Chapter 4 Solutions

C++ How to Program (10th Edition)

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
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr
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