
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
Concept explainers
Question
In C++:
Given the following for loop, write a main
for (i=3; i<18; i=i+3)
cout << i*i << endl;
Expert Solution

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by stepSolved in 3 steps with 1 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.Similar questions
- In C++ What type of loop requires the user to manually terminate the loop? a. counter-controlled while loop b. sentinel-controlled while loop c. eof-controlled while loop d. counter-controlled for looparrow_forwardWrite a while loop that multiplies userNum by 3, assigns userNum with the product, and outputs the updated userNum, followed by a newline. The loop iterates until userNum is greater than or equal to 18. C++ Ex: If input is 4, then the output is: 12 36 1 2 3 4 5 6 7 8 9 10 11 12 #include <iostream> using namespace std; int main() { intuserNum; cin>>userNum; /* Your code goes here */ return0; }arrow_forwardWrite a do while loop in C++ that validates an input classCode. The valid inputs are ‘F’, ’S’, ’J’, or ’R’. Use a boolean variable invalid to assign the invalid expression. Have it output the input and either “ is an INVALID INPUT – Please try again!” or “ is valid – thank you!”. For Example: G is an INVALID INPUT – Please try again! OR F is valid – thank you! Use the following declarations: char classCode; bool invalid;arrow_forward
- 23. Write a C++ program that reads a positive integer n and then prints the following pattern which has got 2n-1 rows of stars. The following pattern shows the required output for the case n = 6. Your cout statement must print only one digit at a time. Therefore you must use a nested loop. You can choose whichever loop structure (for, while, do-while or combination of them) to use. The following diagram shows the answer for n = 6. 1 1 1 1 1 1 1 2 2 3 2 3 4 2 3 4 5 2 3 4 5 2 3 4 5 1 1 2 3 1 2 1 2 3 4 5 6 5 5 1 2 1 3 2 1 4 3 2 1 4 3 2 1 4 3 2 1 4 3 2 1 4 3 2 1 3 2 1 2 1 1arrow_forwardIN C++arrow_forwardIn C++Find the output = for( int a = 5; a >0; a -- ) { cout << "value of a =" << a << endl; } *arrow_forward
- C++ PROBLEM Write a loop to request integer values from the console until the value is a multiple of 4. Example OutputEnter a multiple of 4: 3Enter a multiple of 4: 9Enter a multiple of 4: 8arrow_forwardThis assignment will give you practice on basic C programming. You will implement a few Cprogramsarrow_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