top of page
Search

Write a C Program to Check Odd or Even Using Conditional Operator?




Write a C Program to Check Odd or Even Using Conditional Operator?

#include <stdio.h>

int main()

{

int number;

printf("Enter an integer: ");

scanf("%d", &number);

(number % 2 == 0) ? printf("%d is even.", number) : printf("%d is odd.", number);

return 0;

}


Related Topic: Write a C Program to Check Whether The Entered Number is Even or Odd?

For Video Explanations Check Out Our Playlist on Youtube HERE.


#Interview #Preperation #Placement #OffCampusing #Engineering #OnCampus #PrivateJobPreperation #JobPreperation#CodingPreperation #AMCAT #Automata #JobsforGraduates #HighestPayingJobsforGraduates

#coding #codinglife #codingisfun #codingproblems #CoffeeWithCodes #CWC #Cprogramming #cprogramminglanguage #competitiveprogramming

6 views0 comments
bottom of page