subject

Consider the partially-filled array named a. what does the following loop do? (cin is a scanner object)int[] a = {1, 3, 7, 0, 0, 0}; int size = 3, capacity = 6; int value = cin. nextint(); while (size < capacity & & value > 0){a[size] = value; }
1. reads up to 3 values and places them in the array in the unused space.
2. reads one value and places it in the remaining first unused space endlessly.
3. reads up to 3 values and inserts them in the array in the correct position.
4. crashes at runtime because it tries to write beyond the array.

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 03:10
Write a program that begins by reading in a series of positive integers on a single line of input and then computes and prints the product of those integers. integers are accepted and multiplied until the user enters an integer less than 1. this final number is not part of the product. then, the program prints the product. if the first entered number is negative or 0, the program must print “bad input.” and terminate immediately. next, the program determines and prints the prime factorization of the product, listing the factors in increasing order. if a prime number is not a factor of the product, then it must not appear in the factorization. sample runs are given below. note that if the power of a prime is 1, then that 1 must appear in t
Answers: 3
question
Computers and Technology, 24.06.2019 01:00
Answer these and get 40 points and brainliest
Answers: 1
question
Computers and Technology, 24.06.2019 13:20
In the insert table dialog box, you select the checkbox to create the first row as the header of the table.
Answers: 3
question
Computers and Technology, 24.06.2019 21:30
Write an algorithm to check if a number is even or odd and show with flow chart step by step
Answers: 2
You know the right answer?
Consider the partially-filled array named a. what does the following loop do? (cin is a scanner obj...
Questions
question
Mathematics, 17.09.2020 17:01
question
Mathematics, 17.09.2020 17:01
question
Mathematics, 17.09.2020 17:01
question
Mathematics, 17.09.2020 18:01
question
Mathematics, 17.09.2020 18:01
question
Mathematics, 17.09.2020 18:01
question
Mathematics, 17.09.2020 18:01
question
Mathematics, 17.09.2020 18:01
question
Mathematics, 17.09.2020 18:01
question
Mathematics, 17.09.2020 18:01
question
Mathematics, 17.09.2020 18:01
question
Mathematics, 17.09.2020 18:01
question
World Languages, 17.09.2020 18:01
question
Mathematics, 17.09.2020 18:01
question
Chemistry, 17.09.2020 18:01
question
Mathematics, 17.09.2020 18:01
question
Mathematics, 17.09.2020 18:01
question
Mathematics, 17.09.2020 18:01
question
History, 17.09.2020 18:01
question
Mathematics, 17.09.2020 18:01
Questions on the website: 13722361