adsense

Hii, welcome to my site. My name is Om prakash kartik. This blog helps you to learn programming languages concepts.

Write a program in C to check that the given character is alphabet or digit or special symbol. Using conditional operator

Write a program in C to check that the given character is alphabet or digit or special symbol. Using conditional operator

#include<stdio.h>
#include<conio.h>
 void main()
  {
   char ch;
   printf("Enter a character:-");
   scanf("%c",&ch);
   ch>=65&&ch<=90||ch>97&&ch<=122?printf("%c is alphbet",ch):ch>=48&&ch<=57?printf("%c is digit",ch):printf("%c is special symbol",ch);
    getch();
  }



Output:-

Post a Comment

0 Comments