Advertisement
J2112O

Function Help

May 16th, 2015
303
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.89 KB | None | 0 0
  1.   2 #include <stdio.h>                                                              
  2.   3 #include <stdlib.h>                                                              
  3.   4 void graph(int count);                                                          
  4.   5 int main(void)                                                                  
  5.   6 {                                                                                
  6.   7     int value;                                                                  
  7.   8     value = 2;                                                                  
  8.   9                                                                                  
  9.  10     while(value<=64) {                                                          
  10.  11         graph(value);
  11.  12         printf("Value is %d\n", value):                                                                                      
  12.  13         value = value * 2;                                                      
  13.  14     }                                                                            
  14.  15     return 0;                                                                    
  15.  16 }                                                                                
  16.  17 void graph(int count)                                                            
  17.  18 {                                                                                
  18.  19     int x;                                                                      
  19.  20                                                                                  
  20.  21     for(x=0; x<count; x=x+1)                                                    
  21.  22         putchar('*');                                                            
  22.  23     putchar('\n');                                                              
  23.  24 }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement