File tree 2 files changed +40
-0
lines changed
2 files changed +40
-0
lines changed Original file line number Diff line number Diff line change
1
+ #include <stdio.h>
2
+
3
+ main () {
4
+ int character , i ;
5
+ int character_count [255 ];
6
+
7
+ for (i = 0 ; i <= 255 ; i ++ )
8
+ character_count [i ] = 0 ;
9
+
10
+ while ((character = getchar ()) != EOF )
11
+ ++ character_count [character - '0' ];
12
+
13
+ for (i = 33 ; i <= 127 ; i ++ ) {
14
+ while (character_count [i ] > 0 ) {
15
+ printf ("%s" , "]" );
16
+ -- character_count [i ];
17
+ }
18
+ printf ("%s" , "\n" );
19
+ }
20
+ }
Original file line number Diff line number Diff line change
1
+ #include <stdio.h>
2
+
3
+ float farenheit_to_celcius (int fahrenheit );
4
+
5
+ main ()
6
+ {
7
+ int fahrenheit = 0 ;
8
+
9
+ while (fahrenheit <= 300 ) {
10
+ printf ("%4d %6.1f %s" , fahrenheit , farenheit_to_celcius (fahrenheit ), "\n" );
11
+ fahrenheit = fahrenheit + 20 ;
12
+ }
13
+ }
14
+
15
+ float farenheit_to_celcius (int fahrenheit )
16
+ {
17
+ float celcius ;
18
+ celcius = (5.0 /9.0 ) * (fahrenheit - 32.0 );
19
+ return celcius ;
20
+ }
You can’t perform that action at this time.
0 commit comments