Advertisement
Nabil-Ahmed

Untitled

Jul 5th, 2019
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.28 KB | None | 0 0
  1. // take a range such as A and B from the user and print the even numbers within this range//
  2. #include<stdio.h>
  3. int main()
  4. {
  5. int a,b,i;
  6.  
  7. scanf("%d %d",&a,  &b);
  8. for(i=a; i<=b; i++)
  9.     {
  10.         if(i%2==0)
  11.         {
  12.             printf("%d ",i);
  13.         }
  14.  
  15.     }
  16.  return 0;
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement