Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //function_odd_even
- #include<stdio.h>
- void odd_even(int x);
- int odd_even2(int y);
- int main()
- {
- int num,a;
- while(1){
- printf("Enter number :");
- scanf("%d",&num);
- odd_even(num);
- a=odd_even2(num);
- if(a==1){
- printf("%d it is even(main)\n",num);
- }
- else{
- printf("%d it is odd(main)\n",num);
- }
- }
- return 0;
- }
- void odd_even(int x)
- {
- if(x%2==0){
- printf("%d it is even\n",x);
- }
- else{
- printf("%d it is odd\n",x);
- }
- }
- int odd_even2(int y)
- {
- int a=0;
- if(y%2==0){
- //a=1;//even
- return 1;//
- }
- else{
- //a=0;//odd
- return 0;//
- }
- //return a;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement