Conditional Operator in C

Get Certified in C Programming and Take Your Skills to the Next Level

Program 1

// Implementation of Conditional operator
// ? :

#include<stdio.h>
#include<conio.h>
int main()
{
    system("cls");
     char ch;
     printf("Enter a character: ");
     ch=getche();
     ch=='a'||ch=='e'||ch=='o'||ch=='i'||ch=='u' ||ch=='A'||ch=='E'||ch=='O'||ch=='I'||ch=='U'?printf("\nVowel"):printf("\nNot a Vowel");
    // int a,b,c,d,x,y,z;
    // printf("Enter four Number");
    // scanf("%d%d %d%d",&a,&b,&c,&d);
    // x=a>b?a:b;
    // y=c>d?c:d;
    // z=x>y?x:y;
    // printf("Grater no is %d: ",z);
    return 0;
}

 

If you are Happy with DataFlair, do not forget to make us happy with your positive feedback on Google

courses

DataFlair Team

DataFlair Team provides high-impact content on programming, Java, Python, C++, DSA, AI, ML, data Science, Android, Flutter, MERN, Web Development, and technology. We make complex concepts easy to grasp, helping learners of all levels succeed in their tech careers.

Leave a Reply

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