#include
Output :
- Two methods available in c programing...
Program
|
#include
int main() { int i; printf("Enter an integer: "); scanf("%d", &i); if(i % 2 == 0) printf("%d is even.", i); else printf("%d is odd.", i); return 0; }; |
Output :
(2) Methods Condition Operator
Program
|
#include
#include int main() { int A; printf("Enter an integer: "); scanf("%d", &A); (A % 2 == 0) ? printf("%d is even.", A) : printf("%d is odd.", A); return 0; } |
No comments:
Post a Comment