Question

(Basic C++ Help) Hello, I just want to double check my C++ HW answers. It is a big part of my grade and I strongly appreciate anyone who answers this. Please and thank you!

17. (2 points) What does the following program print? Write your answer inside the box. for (int i-0; is5:it+) Answer: for (inti-015iittǐtt cout << ikk k cout << endl;

0 0
Add a comment Improve this question Transcribed image text
Answer #1

The following output will be printed
0 00 10 20 30 4
1 01 11 21 31 4
2 02 12 22 32 4
3 03 13 23 33 4
4 04 14 24 34 4

for outer loop i=0 then inner loop will repeat for j form 1 to 4 an it will print i value follwed by space value of j so for j=0 it will print 0 0,for j=1 0 1,j=2 0 2, for j=3 0 3 and for j=4 0 4
as there is no space in inner for loop for each iteration it will be like this
0 00 10 20 30 4
similarly for i=1,2,3,4

Add a comment
Know the answer?
Add Answer to:
(Basic C++ Help) Hello, I just want to double check my C++ HW answers. It is...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Hello everyone! I am working on my assignment for C++ and I'm having a bit of...

    Hello everyone! I am working on my assignment for C++ and I'm having a bit of trouble on the value producing functions, I am creating a program wherein I have to input a value and I need to create a function called square value where in it will square the value I have input. I cannot seem to figure out this part. Here is the code that I have so far, and thank you for any help. I greatly appreciate...

  • I need help solving this basic C++ question. I need help fixing my code.   Question: Design...

    I need help solving this basic C++ question. I need help fixing my code.   Question: Design a class called a box that represents a box. Box classes have variables such as the length of the box, width, and height. 1. Member variables shall be dedicated members. 2. Define the creator of the Box Class. The creator may receive all of the data and may not receive any. 3. Add accessor and creator 4. Add an empty function, which indicates whether...

  • Hello, I am working on my final and I am stuck right near the end of...

    Hello, I am working on my final and I am stuck right near the end of the the program. I am making a Tic-Tac-Toe game and I can't seem to figure out how to make the program ask if you would like to play again, and keep the same names for the players that just played, keep track of the player that wins, and display the number of wins said player has, after accepting to keep playing. I am wanting...

  • I need help fixing my code: In C++ *************** 1) I want to sum the digits...

    I need help fixing my code: In C++ *************** 1) I want to sum the digits of an n*n matrix 2) find the average I have completed the rest ****Do not use C++ standard library. You must use pointers and pointer arithmetic to represent the matrix and to navigate through it. MY CODE: (I have indicated at which point I need help) #include <iostream> using namespace std; void swap(int *xp, int *yp) { int temp = *xp; *xp = *yp;...

  • hello, my name Devin im in this online class and i wanna double-check my hw before i submit it. please and thank you. ha...

    hello, my name Devin im in this online class and i wanna double-check my hw before i submit it. please and thank you. have a great job. i appreciate your hard work. all of the answers should be in the form of (m) 13. For each hydrogen ion concentration listed, calculate the solution as the concentration of hydroxide ion in the solution. Indicate whether each solution is acidic or basic .(a) [H+] = 4.85 10-8M (b) [H+] = 8.92 10-3M...

  • Why am I getting the same results with my rand() every time I run my C++...

    Why am I getting the same results with my rand() every time I run my C++ program? I am trying to do this problem: each receive $200 per week plus 9 percent of their gross sales for that week. For example, a salesperson who grosses $5000 in sales in a week receives $200 plus 9 percent of $ 5000, or a total of $650. Write a program(using an array of counters) that determines how many of the salespeople earned salaries...

  • Hello! I'm posting for my class and wanting to check my answers so I can get...

    Hello! I'm posting for my class and wanting to check my answers so I can get as many points as possible for my hw Thank u

  • Hello, I am working on a C++ pick 5 lottery game that gives you the option...

    Hello, I am working on a C++ pick 5 lottery game that gives you the option to play over and over. I have everything working right except that every time the game runs it generates the same winning numbers. I know this is an srand or rand problem, (at least I think it is), but I can't figure out what my mistake is. I've tried moving srand out of the loop, but I'm still getting the same random numbers every...

  • Hello, I need help with my code. The code needs to display random number from 1...

    Hello, I need help with my code. The code needs to display random number from 1 to 50 every time the program runs but the program displays the same random numbers every time. Thanks #include #include using namespace std; void dynAlloc(int size, int *&arr); void displayArray(int *arr, int n); void insertionSort(int *arr, int n, int *temp); void linear_search(int *arr, int n, int key); void binary_search(int *arr, int n, int key); int main() {   const int n = 50; int *arr,...

  • Hello I need help fixing some things so that the C++ code follows all the requirements...

    Hello I need help fixing some things so that the C++ code follows all the requirements listed below. Thanks, This needed to fix: Rule 3 (Not Satisfied): In rule 3 it is asked to use conditional statements only for the base-case and for all other conditional expressions you must use ternary operators. You have used "if", "else" statements multiple times so this rule was not satisfied. Rule 6 (Not Satisfied): As per this rule you are permitted to use upto...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT