C Program to Check Whether Number is Even or Odd Using Conditional Operator

Here, You will know about “C Program to Check Whether Number is Even or Odd Using Conditional Operator“. Below, We will discuss how to do the task using this tutorial? Let’s move.

C Program to Check Whether Number is Even or Odd Using Conditional Operator

C Program to Check Whether Number is Even or Odd Using Conditional Operator

Program Code

#include <stdio.h>
int main()
{
  int n;

  printf("Input an integern");
  scanf("%d", &n);

  n%2 == 0 ? printf("Evenn") : printf("Oddn");

  return 0;
}

Final Words

We hope this article helps you to learn “Check Whether Number is Even or Odd Using Conditional Operator Using C Program”. If you have any doubts about this topic then please let us know via the comment section. We will help you. Share this article with other C/C++ developers.

Share on:

Hi, I'm Ranjith a full-time Blogger, YouTuber, Affiliate Marketer, & founder of Coding Diksha. Here, I post about programming to help developers.

Leave a Comment