Problem Solving with C++ (9th Edition)
Problem Solving with C++ (9th Edition)
9th Edition
ISBN: 9780133591743
Author: Walter Savitch
Publisher: PEARSON
bartleby

Videos

Textbook Question
Book Icon
Chapter 9.2, Problem 15STE

What is the output of the following code fragment? The code is assumed to be embedded in a correct and complete program.

int arraySize = 10;

int *a;

a = new int[arraySize];

int i;

for (i = 0; i < arraySize; i++)

  a [i] = i;

while (*a < 9)

{

a++;

cour << *a << “ ”;

}

cout << endl;

Blurred answer
Students have asked these similar questions
Program in C language (Please solve part 2) Part one : Write a program that does the following: Creates int array array_1 of length 10. Creates int array array_2 of length 10. Takes int values from the user of for 10 values for array_1 and array_2, each. Creates a new int array array_3 which copies the values of array_1 and array_2, in interleaved order, into it. Prints out the contents of Prints out the contents of array_1, array_2 and array_3. Part two : Repeat Part one, but this time use arrays of char (instead of int), and stop receiving input into array_1 and array_2 when the user hits Enter / newline and insert a Null character into the array
One dimension array in C:Create an array of 100 integer elements and initialize the array elements to zero.Populate the array (using a for loop) with the values 10,20,30,..., 990,1000.Write code (using for loops) to sum all the elements and output the sum to the screen. without using #define
Two dimension array in C:Create a two dimension array of integers that is 5 rows x 10 columns.Populate each element in the first 2 rows (using for loops) with the value 5.Populate each element of the last three rows (using for loops) with the value 7.Write code (using for loops) to sum all the elements of the first three columns and output thesum to the screen.
Knowledge Booster
Background pattern image
Computer Science
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
Text book image
C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr
Text book image
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning
Definition of Array; Author: Neso Academy;https://www.youtube.com/watch?v=55l-aZ7_F24;License: Standard Youtube License