answersLogoWhite

0


Best Answer

/* Vertical Histogram of words in a Sentence */

#include<stdio.h>

#define MAXWL 20 /* Maximum length of a word */

#define MAXNO 25 /* Maximum No of words in a sentence */

int main(void)

{

int word[MAXNO];

int i,c,j,nc,nw;

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

word[i]=0;

nc = nw = 0;

while( (c=getchar()) != EOF)

{

++nc;

if( c ==' ' c =='

' c ==' ')

{

word[nw] = nc -1; /* -1 for excluding the space in the word length */

++nw;

nc = 0; /* resetting the word-length for the next word */

}

}

for( i = MAXWL; i >= 1; --i)

{

for(j=0;j <= nw;++j)

{

if( i <= word[j])

putchar('*');

else

putchar(' ');

}

putchar('

');

}

return 0;

}

User Avatar

Wiki User

13y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Write a C program to make a vertical histogram?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

How do you make a histogram when all they give you is numbers?

count it


Give you an example of a histogram?

This is the definition of a histogram: A histogram is a graph showing the intervals and frequencies of a certain topic. That's about all I can give you, because I don't know how to make graphs on here. SORRY!! -belair14, Anna


Can you use a histogram to make a frequency table with intervals?

Yes, you can.


How do you write hundreds?

You make a vertical line for one, and afterward draw two ovals/circles for zeroes.


How do you make a histogram for a data set?

A histogram is basically a bar graph but no spaces in between. That is what I was taught at school a few years ago. But here is a source to check out.


How do you use a histogram in 6th grade math?

After you have your data, when you record it into the histogram, you make a graph just like a bar graph, only, this time the bars are touching! Does that make sense? Please tell me if i'm wrong!:)


How do you write a java program to make a periodic table?

See the related links section for a link to a JAR file containing this program.


Write a program in qbasic to make a hut using print statemant?

a triangle then a square :)


What intervals would you use to make a histogram?

Any intervals which are convenient to construct and also make some logical sense.


Take a matrix[10X10] as a sample image. Compute a Histogram of it. Then use any algorithm to make an image Histogram by changing Grey levels?

. Color histogram Color histogram with a mask (25 min) We can also apply a mask to the images we apply the color histogram process to, in the same way we did for grayscale histograms. Consider this image of a well plate, where various chemical sensors have been applied to water and various concentrations of hydrochloric acid and sodium hydroxide: Well plate image Suppose we are interested in the color histogram of one of the sensors in the well plate image, specifically, the seventh well from the left in the topmost row, which shows Erythrosin B reacting with water. Use ImageJ to find the center of that well and the radius (in pixels) of the well. Then, navigate to the Desktop/workshops/image-processing/05-creating-histograms directory, and edit the ColorHistogramMask.py program. Guided by the comments in the ColorHistogramMask.py program, create a circular mask to select only the desired well. Then, use that mask to apply the color histogram operation to that well. When you execute the program on the plate-01.tif image, your program should display maskedImg, which will look like this: Masked well plate And, the program should produce a color histogram that looks like this: Well plate histogram Solution Histograms for the morphometrics challenge (10 min - optional, not included in timing) Using the grayscale and color histogram programs we developed in this episode, create histograms for the bacteria colonies in the Desktop/workshops/image-processing/10-challenges directory. Save the histograms for later use. Key Points We can load images in grayscale by passing the as_gray=True parameter to the skimage.io.imread() function. We can create histograms of images with the np.histogram function. We can separate the RGB channels of an image using slicing operations. We can display histograms using the matplotlib pyplot figure(), title(), xlabel(), ylabel(), xlim(), plot(), and show() functions. previous episode next episode


How write 6400 dollars?

Step by step tutorial. Write: $, this is done by combining two semi-circles and crossing a vertical line through it. Write: 6, this is done by making half circle connected to a circle. Write: , Write: 4, this is done by making a vertical line, a horizontal one connected 1/4 of the way up the line, then make a diagonal line between the left tip of the horizontal line and the top of the vertical one. Write: 0, this is done my drawing an oval. Write: 0 again The final result should be something like this: $6,400


How do you beat level 6 in factory balls 2?

Do 1 horizontol write Do 1 vertical blue Make sure the base is purple!