C ++ Program Check whether Number is Even or Odd Ternary Operator
#include<iostream> using namespace std; int main() { int a; cout<<"Enter the Number : "; cin>>a; (a%2==0)?cout<<"Number is even":cout<<"Number is odd"; return 0; }
Post a Comment