Advertisement
Denis_Hristov

OddOrEven

Mar 15th, 2024
584
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.28 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. void oddOrEven(int* a){
  5.     if(*a % 2 == 0){
  6.         printf("The number %d is even", *a);
  7.     }else{
  8.         printf("The number %d is odd", *a);
  9.     }
  10.  
  11. }
  12.  
  13.  
  14. int main()
  15. {
  16.     int a = 6;
  17.  
  18.     oddOrEven(&a);
  19.  
  20.     return 0;
  21. }
  22.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement