
Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
expand_more
expand_more
format_list_bulleted
Question
![What is the output of the following code (what is printed to the screen);
int main ()
float b[4] = {2.5,-4,0.2,3};
int d=b[2], p;
p=b[3];
p%=6;
cout << p <« b[1] << " " « d << endl;
return 0;
The following code does not follow the programmer's intent. Explain the programmer's intent (as
conveyed by the format of the code) and how to edit the code to follow the intended action.
int main()
int a;
cout << "Give me a number: ";
cin >> a;
if(a%10==0)
cout << "I like multiples of 10.\n";
else
cout << "I do not like that number. Please enter another number: ";
cin >> a;
cout <« "Thanks for entering another number.\n";
endl;](https://content.bartleby.com/qna-images/question/6900813d-7c23-46b7-a2db-4b3d463f1913/b874c84a-40e8-4ea8-af7f-d76332bc6492/yigp9kp.png)
Transcribed Image Text:What is the output of the following code (what is printed to the screen);
int main ()
float b[4] = {2.5,-4,0.2,3};
int d=b[2], p;
p=b[3];
p%=6;
cout << p <« b[1] << " " « d << endl;
return 0;
The following code does not follow the programmer's intent. Explain the programmer's intent (as
conveyed by the format of the code) and how to edit the code to follow the intended action.
int main()
int a;
cout << "Give me a number: ";
cin >> a;
if(a%10==0)
cout << "I like multiples of 10.\n";
else
cout << "I do not like that number. Please enter another number: ";
cin >> a;
cout <« "Thanks for entering another number.\n";
endl;
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 nowThis is a popular solution!
Step by stepSolved in 2 steps with 1 images

Knowledge Booster
Similar questions
- Note: It`s C++arrow_forwardComplete the C++ function given below:arrow_forwardhelp me solve this in c++ please Write a program that asks the user to enter a list of numbers from 1 to 9 in random order, creates and displays the corresponding 3 by 3 square, and determines whether the resulting square is a Lo Shu Magic Square. Notes Create the square by filling the numbers entered from left to right, top to bottom. Input validation - Do not accept numbers outside the range. Do not accept repeats. Must use two-dimensional arrays in the implementation. Functional decomposition — Program should rely on functions that are consistent with the algorithm.arrow_forward
- ii) Write a C++ program that reads an integer maxAllowed and in output prints all elements less than the value maxAllowed from the array given below. Print -1 if all elements are greater than maxAllowed variable.int Array[10] = {67, 49, 11, 90, 123, 98, 8, 176, 34, 102};arrow_forward18. Given the following C code, what is the value of scores[5]? int scores[10] [95,82);arrow_forward
arrow_back_ios
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education

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