Phr0zen_Penguin

printf Line Wrap

Nov 19th, 2011
199
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.27 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. void main()
  5. {
  6. int a = 0, b = 0, c;
  7.  
  8. printf ("Enter: ");
  9. scanf ("%d", &b);
  10.  
  11. while (a < b){
  12.   c = a % 10;
  13.   a = a + 1;
  14.  
  15.   if (c == 0){
  16.     printf ("\n");
  17.   }
  18.  
  19.   printf ("*");
  20.  
  21. }
  22.  
  23.  
  24. printf ("\n");
  25. system ("pause");
  26. }
  27.  
Advertisement
Add Comment
Please, Sign In to add comment