Integers userVal and maxVal are read from input. If userVal is 1000 or less, assign maxVal with 1000. First image is my attempt , second without
Integers userVal and maxVal are read from input. If userVal is 1000 or less, assign maxVal with 1000. First image is my attempt , second without
Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
Related questions
Question
Integers userVal and maxVal are read from input. If userVal is 1000 or less, assign maxVal with 1000. First image is my attempt , second without

Transcribed Image Text:e
2002
Homepage - Southern New Ham X
https://learn.zybooks.com/zybook/CS-210-T4130-OL-TRAD-UG.23EW4/chapter/3/section/4
F2
boks My library > CS 210: Programming Languages home > 3.4: Detecting ranges with branches
468126.2601242.qx3zqy7
Jump to level 1
Type here to search
X
F3
Integers userVal and maxVal are read from input. If userVal is 1000 or less, assign maxVal with 1000.
Ex: If the input is 1000 450, then the output is:
1000
1 #include <iostream>
2 using namespace std;
3
4 int main() {
5
6
7
8
9
10
11
12
13
14
15
16 }
int userVal;
int maxVal;
cin >> userVal;
cin >> maxVal;
cout << maxVal << endl;
return 0;
1
F4
Bi
1 2-1 zyBooks Participation Activiti X
I
F5
C
41
F6
2
zy Section 3.4- CS 210: Programmir X
F7
F8
3
F9
EzyBooks cata
F10
+
4
F

Transcribed Image Text:Homepage - Southern New Ham X
https://learn.zybooks.com/zybook/CS-210-T4130-OL-TRAD-UG.23EW4/chapter/3/section/4
468126.2601242.qx3zqy7
My library > CS 210: Programming Languages home > 3.4: Detecting ranges with branches
e to search
X
Jump to level 1
1 #include <iostream>
2 using namespace std;
3
4 int main() {
5 int userval;
6
int maxVal;
7
8
9
Integers userVal and maxVal are read from input. If userVal is 1000 or less, assign maxVal with 1000.
Ex: If the input is 1000 450, then the output is:
1000
10
11
12
13
14
15
16
17 }
Check
cin >> userVal;
cin >> maxVal;
if (userVal<- 1000) {
cout << "1000"<< endl;
}
cout << maxVal << endl;
2-1 zyBooks Participation Activiti X
return 0;
1
Et
zy Section 3.4 - CS 210: Programmir X
2
EzyBooks cat
3
Expert Solution

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 2 images

Knowledge Booster
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.Recommended textbooks for you

Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education

Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON

Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON

Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education

Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON

Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON

C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON

Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning

Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education