Write a program that uses an initializer list to store the following set of numbers in an array named nums. Then, print the array. 14 36 31 -2 11 -6 Sample Run [14, 36, 31, -2, 11, -6] (In edhesive please)

Write A Program That Uses An Initializer List To Store The Following Set Of Numbers In An Array Named

Answers

Answer 1

Answer:

nums=[14, 36, 31, -2, 11, -6]

print(nums)

Explanation:

I got a 100%

Answer 2

Answer:

In C++:

#include <iostream>

using namespace std;

int main(){

    int nums[6] = {14, 36, 31, -2, 11, -6};

    cout<<"[";

    for(int i = 0;i<6;i++){

    cout<<nums[i];

    if(i != 5){cout<<", ";}

    }

    cout<<"]";

   return 0;

}

Explanation:

This initializes the array

    int nums[6] = {14, 36, 31, -2, 11, -6};

This prints the opening square bracket

    cout<<"[";

This iterates through the array

    for(int i = 0;i<6;i++){

This prints individual elements of the array

    cout<<nums[i];

Until the last index, this line prints comma after individual array elements

    if(i != 5){cout<<", ";}

    }

This prints the closing square bracket

    cout<<"]";


Related Questions

Other Questions
Help me pls :////// The following are considered organelles except for the - A. chloroplastB. cytoplasmC. mitochondriaD. vacuoleCorrect answer get's brainliest please help :( Please help reward brainliest!!! Somebody help me..... 72% of the students in Math 6 at AZVA are currently mastering there lessons. If 306 students are mastering their math lessons, how many students are in math 6? 5. A logging company cut down all the large spruce trees in an area of forest. After the area was cleared, spruce seedlings began to sprout. Rabbits, birds, and deer returned to the area. A farmer sells 6.3 kilograms of pears and apples at the farmer's market. 4 5 of this weight is pears, and the rest is apples. How many kilograms of apples did she sell at the farmer's market? What is the slope intercept ? AccuBlade Castings Inc. casts blades for turbine engines. Within the Casting Department, alloy is first melted in a crucible, then poured into molds to produce the castings. On May 1, there were 230 pounds of alloy in process, which were 60% complete as to conversion. The Work in Process balance for these 230 pounds was $32,844, determined as follows: Direct materials (230 x $132)$30,360 Conversion (230 x 60% x $18)2,484 $32,844 During May, the Casting Department was charged $350,000 for 2,500 pounds of alloy and $19,840 for direct labor. Factory overhead is applied to the department at a rate of 150% of direct labor. The department transferred out 2,530 pounds of finished castings to the Machining Department. The May 31 inventory in process was 44% complete as to conversion.a. Prepare the following May journal entries for the Casting Department:1. The materials charged to production2. The conversion costs charged to production3. The completed production transferred to the Machining Departmentb. Determine the Work in ProcessCasting Department May 31 balance.c. Compute and evaluate the change in the costs per equivalent unit for direct materials and conversion from the previous month (April). Find the greatest common factor of 16 17 20 In Scene 1, N1 says, The setting sun casts long shadows, making the boys seem taller than they are. What is the symbolic meaning of this line? Nosotros ______ (usar) la computadora en class siempre 1. Which of the following is not a natural occurring event of carbon dioxide being added to the environment?animal respirationdeforestationvolcano eruption This strand of evidence helped to provide a link in the evolution of whales from land mammals on 4 legs to a sea mammal with finsA. EmbryologyB FossilsC. Natural SelectionD. DNA Natalie completed 56 sit-ups. Natalie completed 4 times as many sit-ups as Matthew. How many sit-ups did Matthew complete?14 sit-ups24 sit-ups52 sit-ups224 sit-ups A farmer grows several crops on a farm that has mostly shallow, sandy soil, meaning they havea low water storage capacity and a high infiltration rate. Which of the following irrigationmethods would be the best suited for this farm?Select one:O a. Drip irrigationO b. Surface irrigationO c. Flood irrigationO d. Furrow irrigation Source (Topic) What role does music play in our life? What could be the main idea??? Finding missing anglesplease help!! i really need it What is the solution to the inequalitybelow?X+3> 7A X 4B x 4C3x7 PLEASE HELP ! please please help asap :)