C Programming
C Programming

Ternary Operator

Ternary Operator

C Programming

Ternary Operator

 

Syntax:

Condition ? Expression 1(True)  :  Expression 2(False) ;

Program:

To check wheather the given number is even or odd

 

#include<stdio.h>
int main(){
    int x;
    printf(“Enter aa number\n”);
    scanf(“%d”,&x);
    x%2==0 ? printf(“The number is Even \n”) : printf(“The number is  odd\n”) ;
    return 0;
}

 

 

 

Topics Covered :

  • ternary operator in c
  • ternary operator
  • ternary operator syntax
  • operators in c
  • conditional operator in c
  • operators in c language
  • conditional operator
  • conditional operators
  • operator
  • operators
  • conditional operator example
  • ternary,
  • use of conditional operator
  • programming tutorial
  • programming
  • c programming
  • tutorial
  • c (programming language)
  • c tutorial for beginners
  • c video tutorials
  • coding
  • conditional

 

 


 

Thanks for reading this blog. Hope you get satisfied with the blog and definitely this blog must have valued your time and effort of reading.

Take a time to connect our other digital creations such as Instagram , Facebook and Youtube.

 

🧑‍💻🧑‍💻 Social Media Links of Tech DCode :

👉🏻 YouTube : https://www.youtube.com/channel/UCjJnEdeugftBwQ3yMuD4B_A
👉🏻 Instagram : https://www.instagram.com/thetechdcode/
👉🏻 Facebook Page : https://www.facebook.com/thetechdcode
👉🏻 Twitter : https://twitter.com/thetechdcode
👉🏻 Telegram Channel : https://t.me/thetechdcode
👉🏻 Tech DCode Linktree : https://linktr.ee/thetechdcode
👉🏻 My Personal Handles : https://linktr.ee/virtualshivamin

🧑‍💻🧑‍💻 Social Media Links of SHIVAM SINGH (OWNER) :

👉🏻 Instagram : https://www.instagram.com/virtualshivamin/
👉🏻 Facebook Page : https://www.facebook.com/virtualshivamin/
👉🏻 Twitter : https://twitter.com/virtualshivamin/
👉🏻 Personal Linktree : https://linktr.ee/virtualshivamin 

Leave a Reply

Your email address will not be published. Required fields are marked *