Advertisement
rfmonk

v.002.c

Oct 22nd, 2014
248
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.39 KB | None | 0 0
  1. // write a program that repeatedly accepts user input and then prints
  2. // the numbers between 0 and the entered number. If the user enters
  3. // less than or equal to zero, the program will exit
  4. #include <stdio.h>
  5.  
  6. int main(void)
  7.  
  8. for (i = 0; i >= 1; if i <= 0 return(0));
  9. {
  10.  
  11.     printf("Enter a number: ");
  12.     scanf("%d", &i);
  13.     printf("Your number is %d and half of that is %d * .5", i);
  14.    
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement