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

In c please

Computers and Technology
1 answer:
Paraphin [41]2 years ago
5 0

Answer:

#include <stdio.h>

#include <ctype.h>

void printHistogram(int counters[]) {

   int largest = 0;

   int row,i;

   for (i = 0; i < 26; i++) {

       if (counters[i] > largest) {

           largest = counters[i];

       }

   }

   for (row = largest; row > 0; row--) {

       for (i = 0; i < 26; i++) {

           if (counters[i] >= row) {

               putchar(254);

           }

           else {

               putchar(32);

           }

           putchar(32);

       }

       putchar('\n');

   }

   for (i = 0; i < 26; i++) {

       putchar('a' + i);

       putchar(32);

   }

}

int main() {

   int counters[26] = { 0 };

   int i;

   char c;

   FILE* f;

   fopen_s(&f, "story.txt", "r");

   while (!feof(f)) {

       c = tolower(fgetc(f));

       if (c >= 'a' && c <= 'z') {

           counters[c-'a']++;

       }

   }

   for (i = 0; i < 26; i++) {

       printf("%c was used %d times.\n", 'a'+i, counters[i]);

   }

   printf("\nHere is a histogram:\n");

   printHistogram(counters);

}

You might be interested in
Analyze the problem statement. Select the correct answer. Vision: We want to decrease errors in our billings to clients. Issue:
finlep [7]

Answer: This problem statement does not provide a useful issue statement.

3 0
2 years ago
Activities called ___________ involve the microprocessor receiving commands as software carries out tasks and while input arrive
Damm [24]

I guess the answer in the blank is processes.

Activities called processes involve the microprocessor receiving commands as software carries out tasks and while input arrives from the keyboard, mouse, and other devices.

6 0
3 years ago
When breaking a problem down, you often encounter elements that you want to use repeatedly in your code. Sometimes it's appropri
ddd [48]

<u>Answer:</u>

<em>FUNCTION:</em>

  • A function does not require the number of times that the <em>code script needs to be executed </em>
  • When we go for large programming, ie. while creating projects, we can invoke function from one file to another based on the access <em>specifier mentioned for the function. </em>
  • There is a stack call created in the memory whenever a <em>function is called. </em>

<em>LOOP :</em>

  • Whereas the number of times that the loop has to be <em>executed must be defined </em>
  • A loop cannot be called, it can be used only the code block in <em>which it is present. </em>
  • There is not overhead of creating a stack since it is not invoked and there is no <em>transfer of control from one module to another </em>

8 0
3 years ago
Your ipad has an application that will not stop running. what feature/tool can you use to stop it? kill treason task manager for
saveliy_v [14]

you could force quit

6 0
2 years ago
Read 2 more answers
The random module is a group of functions that are used to deal with random numbers.
maksim [4K]
True because it is the
5 0
2 years ago
Read 2 more answers
Other questions:
  • 2. A body is thrown vertically<br>100 m/s Theme taken to retum​
    13·1 answer
  • Which of the following is the net effect of the following combination of share and NTFS permissions when the share is accessed o
    7·1 answer
  • Suppose barriers to entry exist in the telecommunications industry. This best describes a _____ market.
    12·1 answer
  • VOTE!
    11·1 answer
  • File-sharing utilities and client-to-client communication applications can provide the capability to share files with other user
    14·1 answer
  • At the start of the school year, Brianna’s history teacher announces that students’ final grades will be weighted based on how t
    8·2 answers
  • Moving your Sprite from right to left is considered the X coordinate?
    5·1 answer
  • What is the difference between the byte and short data types in Java?
    7·1 answer
  • The sequence of Figures shows a pattern. if the pattern repeats, how many triangles will the figure 5 have ?​
    7·1 answer
  • Write a Python program that uses three variables. The variables in your program
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!