Guest User

Untitled

a guest
Mar 23rd, 2018
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int main()
  5. {
  6. int a;
  7. printf("Please give me a number: ");
  8. scanf ("%i",&a);
  9. if ( a < 0)
  10. {
  11. printf("ERROR. The number is smaller than zero.");
  12. return 1;
  13. }
  14. while ( a >= 1)
  15. {
  16. a = a-1;
  17.  
  18. printf("%i\n",a);
  19. }
  20. //for (a>0 ; a>=0 ; a = a-1)
  21. //{
  22. //printf("%i\n",a);
  23. //}
  24. return 0;
  25. }
Add Comment
Please, Sign In to add comment