1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
larisa86 [58]
2 years ago
10

Write a program that uses an initializer list to store the following set of numbers in an array named nums. Then, print the arra

y. 14 36 31 -2 11 -6 Sample Run [14, 36, 31, -2, 11, -6] (In edhesive please)

Computers and Technology
2 answers:
dem82 [27]2 years ago
5 0

Answer:

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

print(nums)

Explanation:

I got a 100%

rodikova [14]2 years ago
4 0

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

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

    }

This prints the closing square bracket

    cout<<"]";

You might be interested in
Select the correct navigational path to create a combination chart. Select the chart. Click the Chart Tools tab. Select the data
nydimaria [60]

Answer:

format and design

Explanation:

8 0
2 years ago
What is the default junk email protection in Outlook 2016?
Shtirlitz [24]
The answer to ur question is D
4 0
3 years ago
Read 2 more answers
Baby Boomers are an example of what type of trend?
Bond [772]
The baby boomers is a type of demographic group. The demographic groups are usually categorized by age, income bracket, social class and so on. Baby boomers are classified as a generation of a group of people and also therefore, by their age range. 
8 0
3 years ago
Read 2 more answers
What's the best definition of financial literacy?
8090 [49]

Answer:

defines personal financial literacy as "the ability to use knowledge and skills to manage financial resources effectively for a lifetime of financial well-being.\

Explanation: thats it

5 0
2 years ago
Write a program which accepts two integers from the user. Then it asks the user what he wants to do with those two numbers. If t
il63 [147K]

Answer:

// program in C++.

#include <bits/stdc++.h>

using namespace std;

// function to print choice menu

void menu()

{

   cout<<"A – Add the two numbers:"<<endl;

   cout<<"B – Subtract the second number from the first number:"<<endl;

   cout<<"C – Multiply the first number by the second number:"<<endl;

   cout<<"D – Divide the first number by the second number:"<<endl;

   cout<<"Q – End the operation:"<<endl;

}

// driver function

int main()

{

// variables

int x,y;

char ch;

int flag=1;

do{

   cout<<"Enter first number:";

   // read first number

   cin>>x;

   cout<<"Enter second number:";

   // read second number

   cin>>y;

   // call menu function

   menu();

   cout<<"Enter your choice:";

   // read choice

   cin>>ch;

   switch(ch)

   {

       case 'A':

       case 'a':

       cout<<"Addition of two numbers is:"<<(x+y)<<endl;

       break;

       case 'B':

       case 'b':

       cout<<"Subtract the second from the first is:"<<(x-y)<<endl;

       break;

       case 'C':

       case 'c':

       cout<<"Multiplication of two numbers is:"<<(x*y)<<endl;

       break;

       case 'D':

       case 'd':

       cout<<"Division the first by the second is:"<<(x/y)<<endl;

       break;

       case 'Q':

       case 'q':

       flag=0;

   }

   if(flag==0)

   break;

   

}while(ch!='Q'||ch!='q');

return 0;

}

Explanation:

Read two numbers from user.Then read the choice for operation on both the numbers. Then print the choices of operation by calling menu() function.If choice is "A"  then print Addition of both.if choice is "B" then print subtraction of second from  first number.if choice is "C" then print the multiplication of both numbers.If choice is "D" then print division of first by second.If the choice is "Q" then quit the operation. Repeat this until user's choice is "Q".

Output:

Enter first number:6                                                                                                      

Enter second number:2                                                                                                      

A – Add the two numbers:                                                                                                  

B – Subtract the second number from the first number:                                                                      

C – Multiply the first number by the second number:                                                                        

D – Divide the first number by the second number:                                                                          

Q – End the operation:                                                                                                    

Enter your choice:A                                                                                                        

Addition of two numbers is:8                                                                                              

Enter first number:8                                                                                                      

Enter second number:2                                                                                                      

A – Add the two numbers:                                                                                                  

B – Subtract the second number from the first number:                                                                      

C – Multiply the first number by the second number:                                                                        

D – Divide the first number by the second number:                                                                          

Q – End the operation:                                                                                                    

Enter your choice:Q      

3 0
3 years ago
Other questions:
  • To move up one paragraph, press the ____ key(s). f1 alt up arrow up arrow ctrl up arrow
    8·1 answer
  • When working in Excel Online, what is it called when you drag the fill handle down to copy data?
    10·2 answers
  • Is virtualization self monitoring
    6·1 answer
  • All web page urls begin with the letters ____.
    6·1 answer
  • Complete each sentence using the drop-down menu. Information on local driving laws can be found on a website. A class textbook c
    9·2 answers
  • What is the HCF of smallest prime number and the smallest composite number?​
    12·1 answer
  • Stephanie would like to know the average number of regular hours worked by her employees. In cell B11, create a formula using th
    8·1 answer
  • Python;
    6·1 answer
  • Identify the names of the following:<br><br>Please help me.​
    12·1 answer
  • Physical and data link layer standards govern transmission in ________. LANs WANs Both LANs and WANs Neither LANs nor WANs
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!