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
lesantik [10]
3 years ago
13

In C language

Computers and Technology
1 answer:
devlian [24]3 years ago
8 0

Answer:

The program in C is as follows:

#include <stdio.h>

#include <stdlib.h>

#include <time.h>

int main(){

   int dice [1000];

   int count [6]={0};

   srand(time(0));

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

       dice[i] = (rand() %(6)) + 1;

       count[dice[i]-1]++;

   }

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

       printf("%d %s %d %s",(i+1)," occurs ",count[i]," times");

       printf("\n");

   }

   return 0;

}

Explanation:

This declares an array that hold each outcome

   int dice [1000];

This declares an array that holds the count of each outcome

   int count [6]={0};

This lets the program generate different random numbers

   srand(time(0));

This loop is repeated 1000 times

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

This generates an outcome between 1 and 6 (inclusive)

       dice[i] = (rand() %(6)) + 1;

This counts the occurrence of each outcome

       count[dice[i]-1]++;    }

The following prints the occurrence of each outcome

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

       printf("%d %s %d %s",(i+1)," occurs ",count[i]," times");

       printf("\n");    }

You might be interested in
What area displays the title of the document
stich3 [128]

Answer:

The Title Bar

Explanation:

It is the part of the Software that not only tells you the name/title of the software but also the file name.

8 0
4 years ago
Read 2 more answers
Which question would you ask when proposing a private cloud?
Ludmilka [50]
I think the answer would be C :)
5 0
3 years ago
Read 2 more answers
The term BIOS stands for
marissa [1.9K]
BIOS stands for basic input and output system. It is a program used during the start-up (or booting process) of a computer or device. Hope this helps! :)
3 0
3 years ago
Read 2 more answers
1. You want to find if TCP/IP Services are working properly on your Computer, you would use which command? a. PING LOCALHOST b.
Olegator [25]

Answer:

Option A

Explanation:

Option B is rejected because it is used to get the startup network settings, processes extra features used by the network.

Option C is rejected because it is used to check the stats like ping,fps of the network by using a loop back.

Option A is selected because PING command is used to check the data packets transfer rate between two ends using ICMP protocol. Local host means that you are specifying the one end as your side. If the packets are there then it is working else the IP service is down.

3 0
3 years ago
PLEASE HELP!! Kou converged his Word document to a PowerPoint document. When he received the PowerPoint, he was missing material
uranmaximum [27]
C: He forgot to save some certain materials in the PowerPoint.
7 0
3 years ago
Other questions:
  • Does technology get in the way of learning ?<br> Help Meh ! ♥ Some ideas :D
    14·2 answers
  • An existing document that you use as a starting point for a new document; it opens a copy of itself, unnamed, and then you use t
    15·1 answer
  • is either the number of bits used to indicate the color of a single pixel, or the number of bits used for each color component o
    7·1 answer
  • Only the Windows Server 2016 Standard and Datacenter editions are compatible with the common language runtime used in Microsoft
    7·1 answer
  • When installing a network cable with multiple strands, a network technician pulled the cable past a sharp edge and exposes the c
    13·1 answer
  • Agent Phil Coulson developed this program to register Avengers in S.H.I.E.L.D's database using cutting-edge programming language
    15·1 answer
  • How do I send the face to the back? Seriously, I can't find out how...
    13·1 answer
  • If we assume the modern view of existential import, why is the following syllogism invalid? No computer is made of clay. All com
    15·1 answer
  • Why are computer manufacture constantly releases fast computer and do user benefit from ths speed
    9·1 answer
  • Mha rp anyone? ima be baby shoto
    14·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!