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
Greeley [361]
2 years ago
7

write a program in which the user can enter X amount of numbers. Once the user has enter 10 positive numbers, the user may not e

nter anymore numbers. Then the program should display the sum of those 10 positive number and also display the 10 positive numbers.
Computers and Technology
1 answer:
11111nata11111 [884]2 years ago
7 0

Answer:

The following code is in C++.

#include <iostream>

using namespace std;

int main() {

   int a[10],sum=0;//declaring an array and initialized variable sum with value 0.

   cout<<"Enter the numbers"<<endl;

   for(int i=0;i<10;i++)

   {

       cin>>a[i]; //taking input of 10 integers.

   }

   for(int i=0;i<10;i++)

   {

       sum=sum+a[i];//finding the sum..

   }

   cout<<"The sum is : "<<sum<<endl<<"The numbers entered are "<<endl;

   for(int i=0;i<10;i++)

   {

       cout<<a[i]<<" ";//displaying the elements.

   }

return 0;

}

Output:-

Enter the numbers

1 2 3 4 5 6 7 8 9 10

The sum is : 55

The numbers entered are  

1 2 3 4 5 6 7 8 9 10

Explanation:

I have taken an array of size 10 so that no more than 10 integers could fit in it.After that taking the input from the user prompting 10 integers using the for loop.After that finding the sum.Then printing the sum and the numbers entered.

You might be interested in
Which types of scenarios would the NETWORKDAYS function help calculate? Check all that apply.
inna [77]

Answer:

A. days of vacation time left

B. days of school left in the year

D. years of service someone performed

Explanation:

The NETWORKDAYS function is a built in excel function which makes it easy to calculate the number of days between two specified dates the start date and the end date, this function when applied excludes weekends from the days calculated and one has the opportunity of specifying certain holidays. With this function. The number of days till vacation, the number school days left. The NETWORKDAYS is a very versatile function.

7 0
2 years ago
Write a program that finds the largest in a series of numbers entered by the user.The program must prompt the user to enter numb
Kobotan [32]

Answer:

Here is c program:

#include<stdio.h>

#include<conio.h>

void main()

{

//Variable declaration

//array to hold 6 values you can change this as needed

float nums[6];

//integer i is for loop variable

int i;

//to hold maximum value

float max=0.0;

//clear screen

clrscr();

//iterate 6 times you can change as per your need

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

{

printf("Enter a number:");

scanf("%f",&nums[i]);

//check if entered value is greater than previous value

//if it is greater then assign it

if(nums[i]>max)

max = nums[i];

}

//print the value

printf("The largest number entered was %f",max);

getch();

}

Explanation:

4 0
3 years ago
Step 1: Configure the initial settings on R1. Note: If you have difficulty remembering the commands, refer to the content for th
Andru [333]

Answer:

The configuration of the R1 is as follows

Explanation:

Router>enable

Router#show running-config

Router#show startup-config

Router#configure terminal

Router(config)#hostname R1

R1(config)#line console 0

R1(config-line)#password letmein

R1(config-line)#login

R1(config-line)#exit

R1(config)#enable password cisco

R1(config)#enable secret itsasecret

R1(config)#service password-encryption

R1(config)#banner motd #Unauthorized access is strictly prohibited#

R1(config)#end

R1#exit

R1>enable

R1#copy running-config startup-config

R1#show flash

R1#copy startup-config flash

3 0
2 years ago
Plz can someone tell me the answers ?
Ganezh [65]

Answer:

you can

Explanation:

you can

5 0
2 years ago
Read 2 more answers
A bulb has a resistance of 15Ω and is rated at 3A. What is the maximum voltage that can be applied across the bulb?
Anastasy [175]

Answer:Wheres the option choice??????????????????????

Explanation:

7 0
2 years ago
Other questions:
  • The most popular way for hackers to take over hosts today is ________.
    15·2 answers
  • Domain of (x+8)/(x(x+10))
    12·1 answer
  • . Does Zuckerberg believe in the thought that “the endpoint is when you sell the
    15·1 answer
  • _____ is a school-to-work program that provides the student with paid employment, school credit, and grades while participating.
    14·2 answers
  • What is a printed copy of computer output called
    10·2 answers
  • What does the merge &amp; center button in the alignment group on the home tab do?
    8·1 answer
  • How many mustangs are built every day
    13·2 answers
  • Describe a NIC card and can you have more than one?
    13·1 answer
  • 1. A _______ causes the computer program to behave in an incorrect or unexpected way.
    10·2 answers
  • System development life cycle
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!