fork download
  1. #include <stdio.h>
  2.  
  3. #define SIZE 10
  4.  
  5. int main(void)
  6. {
  7. const char* stars = "**********";
  8.  
  9. const int freqs[ SIZE ] = { 3, 5, 6, 2, 0, 7, 10, 9, 4, 8 };
  10.  
  11. for ( int i = 0; i < SIZE; i++ )
  12. {
  13. printf("%5d \t %10.*s\n", freqs[i], freqs[i], stars);
  14. }
  15.  
  16. return 0;
  17. }
  18.  
Success #stdin #stdout 0s 9424KB
stdin
Standard input is empty
stdout
    3 	        ***
    5 	      *****
    6 	     ******
    2 	         **
    0 	           
    7 	    *******
   10 	 **********
    9 	  *********
    4 	       ****
    8 	   ********