2. Given the program below, which statement is right? float a[5]; for (int i = 0; i< 3; i++) cin>>a[i]; A. The type of the array is double. B. The maximum allowed index of the array is 5. C. The loop will take 3 values from the input. D. None of the above is right.
Added by Ruben C.
Close
Step 1
The declaration "float a[5];" tells us that the type of the array is float. So, statement A is correct. Show more…
Show all steps
Your feedback will help us improve your experience
William Mead and 97 other AP CS educators are ready to help you.
Ask a new question
Labs
Want to see this concept in action?
Explore this concept interactively to see how it behaves as you change inputs.
Key Concepts
Recommended Videos
Choose the statement that does uot apply to the following declaration: double $\mathrm{I}$ 1 totalcostof Items \[ \{109.95,169.95,1.50,89.95\} \] a. declares a one-dimensional array of floating-point values b. specifies the size of the array as five c. sets the array element totalcostofItems [1] to 169.95 d. declares an area in memory where data of double type can be stored e. all are correct
Choose the statement that does not apply to the following declaration: doubleƒ[ , ]ƒtotalCostOfItemsƒ=ƒ ƒƒƒƒ{{109.95,ƒ169.95,ƒ1.50,ƒ89.95}{27.9, 18.6, 26.8, 98.5}}; a. declares a two-dimensional array of floating-point values b. establishes the maximum number of rows as 4 c. sets the array element totalCostOfItems [0, 1] to 169.95 d. declares an area in memory where data of double type can be stored e. all are correct
#include<iostream> using namespace std; int main() { int a, b; cout << "Enter two positive integers, the first smaller than the second." << endl; cout << "First: "; cin >> a; cout << "Second: "; cin >> b; /* Your code goes here */ return 0; }
Aarya B.
Recommended Textbooks
Computer Science and Information Technology
Introduction to Programming Using Python
Computer Science - An Overview
18,000,000+
Students on Numerade
Trusted by students at 8,000+ universities
Watch the video solution with this free unlock.
EMAIL
PASSWORD