Advertisement
mhdew

Counts the odds

Nov 23rd, 2017
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.21 KB | None | 0 0
  1. #include<stdio.h>
  2.  
  3. int main()
  4. {
  5. int i, a, b, count=0;
  6.  
  7. scanf("%d%d", &a,&b);
  8.  
  9. for(i=a;i<=b;i++){
  10. if(i%2==1)
  11. count++;
  12. }
  13. printf("%d\n", count);
  14.  
  15. return 0;
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement