al__nasim

even or odd upto 2^100

Apr 7th, 2016
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. //even or odd upto 2^100
  2. #include<stdio.h>
  3. int main()
  4. {
  5. int i,t;
  6. char num[101];
  7. scanf("%d",&t);
  8. for(i = 0; i<t; i++)
  9. {
  10. scanf("%s",&num);
  11. if((num[strlen(num)-1]) % 2 == 0)
  12. printf("even\n");
  13. else
  14. printf("odd\n");
  15. }
  16. return 0;
  17.  
  18. }
Advertisement
Add Comment
Please, Sign In to add comment