EX: what is logic to print given number is even or odd. C program to print given number is even or odd.how to print given number is even or odd.
Logic to print given number is even or odd:
1. In this Program we will take number from user using no variable.
2. Next we will check it is even or odd using the (no%2==0).
3. Means if no is complete divisible by 2 then it is even otherwise number is odd.
4. Display this output using input/output function.
Program:
Logic to print given number is even or odd:
1. In this Program we will take number from user using no variable.
2. Next we will check it is even or odd using the (no%2==0).
3. Means if no is complete divisible by 2 then it is even otherwise number is odd.
4. Display this output using input/output function.
Program:
No comments:
Post a Comment
If you have any doubts, please discuss here...