1.C program to find odd or even number.
1.C program to find odd or even number.
Solution:
Explanation :-
Even Number: A number that is divisible by 2 without a remainder.
Examples: 0, 2, 4, 6, 8, 10, ...
Odd Number: A number that leaves a remainder 1 when divided by 2.
Examples: 1, 3, 5, 7, 9, ...
main logic
To check if a number is odd or even, we use the modulus operator % in C.
% is the modulus operator. It gives the remainder.
If a number divided by 2 gives remainder 0, it's even.
Otherwise, it's odd.
“Boom! Another program cracked! Let’s keep going. 🚀”