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
mamaluj [8]
4 years ago
7

1. Declare two dimensional double array with 3 rows and 4 columns. a) Use scanf to read the elements for this array. b) Write a

function that computes the average of the above array. c) Write a function that computes the minimum of the above array.
Computers and Technology
1 answer:
Kobotan [32]4 years ago
8 0

Answer:

Following are the program in the C Programming Language:

#include <stdio.h> //header file

float avgs(int a[3][4]){ //define function

 int s =0, c=0; //set integer type variable

 float avg=0;   //set float type variable

 //set for loops to find sum of an array

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

   for (int j = 0; j < 4; j++){

   s = s + a[i][j];

   c +=1;

   }

 }

 //find average of an array  

 avg = s / c;

 return avg;

}

int min(int a[3][4]){//define function

 int m = a[0][0];  //set integer type variable  

 //set for loop for traversing

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

 {  for (int j = 0; j < 4; j++){

     if(m > a[i][j])

       m = a[i][j];

   }

 }

 return m;

}

int main(){//define main function

 int a[3][4];//set integer type Array

 printf("Enter the elements of an array:\n");

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

  for (int j = 0; j < 4; j++)

     scanf("%d", &a[i][j]);

 printf("\n Average of an array: %f", avgs(a));

 printf("\n Smallest element of an array: %d", min(a));

 return 0;

}

Explanation:

Here, we define header file "stdio.h" for print or scan the data.

Then, we define float type function "avgs()" for find the average of an array inside it.

  • we set two integer type variable for sum and count
  • we set float type variable to store average of an array
  • we set the for loops for the sum of an array.
  • we divide sum from count to find average and return it.

Then, we define integer type function "min()" to find the minimum value of an array.

  • we set integer type variable to store array elements
  • we set the for loops for traversing the array
  • we set if statement to find minimum value of an array.
  • we return the minimum value of an array.

Then, we define integer type "main()" function to call both the functions.

  • we set integer type array variable and get input from the user in it with the help of for loops.
  • we call both the functions with message and return 0.

You might be interested in
What is the purpose of system software?
Lilit [14]

The purpose of system software on a computer system is: B. to provide basic operational functionality by coordinating hardware components.

<h3>What is a software?</h3>

A software can be defined as a set of executable instructions that is typically used to instruct a computer system on how to perform a specific task (function) and proffer solutions to a particular problem.

<h3>The types of software.</h3>

Generally, there are three main types of software and these include the following:

  1. Application software
  2. Utility software
  3. System software

In Computer technology, a system software is the most important pre-installed software because it allows an end user to use the computer the first time he or she turns it on, especially by coordinating hardware components. Also, some examples of a system software include the following:

  • Utilities.
  • Search engines
  • Stand-alone operating systems.
  • Real-time operating systems.

Read more on system software here: brainly.com/question/1416480

#SPJ1

6 0
1 year ago
Which XXX will prompt the user to enter a value greater than 10, until a value that is greater than 10 is actually input?
aleksley [76]

Answer:

b. (userInput < 10)

Explanation:

The piece of code that will accomplish this would be (userInput < 10). The code will first ask the user to "Enter a number greater than 10:" then it will compare the value of userInput to 10, if it is less than 10 it will redo the loop over and over again until the userInput is greater than 10. Once the userInput is greater than 10 it will break out of the do-while loop and continue whatever code is written under and outside the do-while loop

4 0
3 years ago
A network host with an IP address of 192.168.10.200 wants to send a message to a destination computer with an assigned IP addres
Mariulka [41]

Answer:

A Subnet Mask

Explanation:

A Subnet mask is used by the TCP/IP protocol to determine whether a host is on the local Subnet or on a remote network.

In TCP/IP, the parts of the IP address that are used as the network and host addresses are not fixed, so the destination host address 192.168.10.100 cannot be determined by the network host (192.168.10.200) unless it has more information. This information is supplied in another 32-bit number called a Subnet mask.

4 0
4 years ago
What can you do with youtube red that you cant do with a normal account?
ipn [44]
No, Ad's. Extra Videos Created By Youtube, and thats about it lol oh and you can play the audio in the background of your phone, like lets say your listening to some music on youtube, and you want to play a game on your phone while listening to that tune on youtube, i just said screw youtube, i jailbroke my device and i have 20X more control of my youtube setting, etc.. and plus i can do more without youtube red tbh lol.
7 0
3 years ago
Read 2 more answers
What does the octal number 362 represent in the decimal system?
kykrilka [37]
The answer is E. 242
8 0
3 years ago
Other questions:
  • What is a data mining??
    5·1 answer
  • For this lab, youhave to write a programnamedseriesFunction.cthat prompts user to enter two values, x and n. Then it would use a
    11·1 answer
  • Which statement describing an operating system's Search feature is true?
    5·1 answer
  • C programming: loading a dictionary into a trie data structure. Why am I segfaulting?
    8·1 answer
  • A customer seeks to buy a new computer for private use at home. The customer primarily needs the computer to use the Microsoft P
    9·1 answer
  • You are network administrator for an Active Directory forest with a single domain. Then network has three sites with one domain
    12·1 answer
  • Ayuda necesito 7 objetos que se utilizan en la vida diaria
    8·1 answer
  • Write a program with class name Digits that prompts the user to input a positive integer and then outputs the number reversed an
    6·1 answer
  • HELP ME ILL GIVE BRAINLY Input 50 numbers and then output the average of the negative numbers only. Write in pseudocode!
    11·1 answer
  • What are the different types of topology?​ in details
    5·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!