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
Leviafan [203]
3 years ago
12

Write a main function that declares an array of 100 ints. Fill the array with random values between 1 and 100.Calculate the aver

age of the values in the array. Output the average.
Computers and Technology
1 answer:
const2013 [10]3 years ago
4 0

Answer:

#include <stdio.h>

int main()

{

   int avg = 0;

   int sum =0;

   int x=0;

   /* Array- declaration – length 4*/

   int num[4];

   /* We are using a for loop to traverse through the array

    * while storing the entered values in the array

    */

   for (x=0; x<4;x++)

   {

       printf("Enter number %d \n", (x+1));

       scanf("%d", &num[x]);

   }

   for (x=0; x<4;x++)

   {

       sum = sum+num[x];

   }

   avg = sum/4;

   printf("Average of entered number is: %d", avg);

   return 0;

}

You might be interested in
What keyword is used to declare a method in python?
Harrizon [31]
I think the answer is B
8 0
3 years ago
CLS
Ainat [17]

Answer:

INPUT "Enter your marks in computer"<u><em>;</em></u>CS

<u><em>IF</em></u> C>40 THEN

PRINT "You are passed. <u><em>"</em></u>

ELSE

PRINT "You are failed."

END <u><em>IF</em></u>

Explanation:

see corrections above.

5 0
4 years ago
In this lab, you declare and initialize variables in a C++ program. The program, which is saved in a file named NewAge.cpp, calc
Ne4ueva [31]

Answer:

#include <iostream>

using namespace std;

int main() {

int currentYear = 2020;

int myCurrentAge = 23;

int myNewAge=myCurrentAge+(2050-currentYear);

cout << "My Current Age is " << myCurrentAge << endl;

cout << "I will be " << myNewAge << " in 2050." << endl;

}

Explanation:

  • Initialize the currentYear with 2020 and myCurrentAge with 23.
  • Add myCurrentAge with the the result of (2015 - currentYear) and assign this result to myNewAge variable.
  • Finally display my current age and after that display the new age in 2050.

Output:

My Current Age is 23

I will be 53 in 2050.

6 0
3 years ago
Which of the following is an example of an inline element? A. B. C. D.
____ [38]
what are the answers??
3 0
2 years ago
3. What is a web directory? What are the key differences between web directories
MrMuchimi

Answer:

web directories are much smaller and more specific than search engines

3 0
2 years ago
Other questions:
  • What is the main idea of this article? Please someone help me. I will give brainliest answer
    7·1 answer
  • How do you read a column
    8·1 answer
  • If 10 ft lb of torque is applied at gear A, then what is the output torque at gear D?
    15·1 answer
  • Katarina is deciding whether to buy a desktop or a laptop computer. What will most likely help Katarina make her decision?
    10·2 answers
  • HURRY
    8·1 answer
  • What is MS-Word? Write some versions of MS-Word.
    8·2 answers
  • Find the unknown quantities
    12·1 answer
  • According to Chargaff's data, ________ must pair with ________, and ________ must pair with ________.
    8·1 answer
  • Which system provides an easier way for people to communicate with a computer than a graphical user interface (GUI)
    6·1 answer
  • A Product Manager has been given responsibility for overseeing the development of a new software application that will be deploy
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!