finclude <1ostream ean nane pace std; nt main () Snt a- 10 //Line 1 SA b- 2O //Line 2 HA C - 30: //Line 3 4Rt d- 40: //Line 4 cout « "Line 5: cin - " « cin « endl, //Line 5 cout « "Line 6: Enter four integers: "1 //Line 6 cin > a » b » c » d, //Line 7 cout <« endl; //Line 8 cout « "Line 9: The numbers you entered are:" < endl, cout « "Line 10: a - " « a « ", b -" «b « ", c - - «c < ", d-"<

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
icon
Related questions
Question
Finclude <iostream>
nt main()
- 107
//Line 1
//Line 2
EA b-20
ENU C 30;
//Line 3
nt d- 40;
cout « "Line 5: cin - " « cin « endl;
//Line 4
//Line 5
cout « "Line 6: Enter four integers: "I
//Line 6
cin » a » b >» c » d;
//Line 7
cout « endl;
//Line 8
cout « "Line 9: The numbers you entered are:"
Line 9
< endl;
/ine 10
cout « "Line 10: a - " << a « ", b -" «b « ", c
<c < ", d- " <« d « endl;
cout « "Line 11: cin - " « cin « endl;
cout « "Line 12: cin.fail () returns " « cin.fail()
//Iine 11
//ine 12
< endl/
cout « "Line 13: Now we will use cin.clear ()." « endl,
//Ane 13
cin.clear ():
//ine 14
cout « "Line 15: cin - " « cin <« endl;
//Line 15
cout « "Line 16: cin.fail() returns " « cin.fail () ,
//Line 16
return 0,
1. Execute the program using the following input values:
34K67 28
Attach the output screen of a successful execution of your program below (Hint: Use the snipping tool to take screenshots
2 Analyze the output of the program and explaln how the Input stream statements to explain how the clear and fail functions
work.
Transcribed Image Text:Finclude <iostream> nt main() - 107 //Line 1 //Line 2 EA b-20 ENU C 30; //Line 3 nt d- 40; cout « "Line 5: cin - " « cin « endl; //Line 4 //Line 5 cout « "Line 6: Enter four integers: "I //Line 6 cin » a » b >» c » d; //Line 7 cout « endl; //Line 8 cout « "Line 9: The numbers you entered are:" Line 9 < endl; /ine 10 cout « "Line 10: a - " << a « ", b -" «b « ", c <c < ", d- " <« d « endl; cout « "Line 11: cin - " « cin « endl; cout « "Line 12: cin.fail () returns " « cin.fail() //Iine 11 //ine 12 < endl/ cout « "Line 13: Now we will use cin.clear ()." « endl, //Ane 13 cin.clear (): //ine 14 cout « "Line 15: cin - " « cin <« endl; //Line 15 cout « "Line 16: cin.fail() returns " « cin.fail () , //Line 16 return 0, 1. Execute the program using the following input values: 34K67 28 Attach the output screen of a successful execution of your program below (Hint: Use the snipping tool to take screenshots 2 Analyze the output of the program and explaln how the Input stream statements to explain how the clear and fail functions work.
Expert Solution
steps

Step by step

Solved in 2 steps with 2 images

Blurred answer
Knowledge Booster
Concept of memory addresses in pointers
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
Database System Concepts
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)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education