prev | Logical OR 21. Arithmetic operator or not (1.7.2009) /* Program# 21 date : 25-12-2008 Arithmetic operator or Not */ #include <stdio.h> main(){ char a; printf("\nEnter an operator :"); scanf("%c",&a); if(a=='+' ||a=='-'||a=='*'||a=='/') printf("\n %c: Arithmetic operator",a); else printf("\n %c: Not a Arithmetic operator",a); } output: Enter an operator : + +: Arithmetic operator Things to note: Single digit, a single specical symbol also a character constant. |
next |