Operator

#include<stdio.h>
void operator(char op)
{
switch(op)
{

case '<':
case '>':
    printf("\n\t Relational operator");
    break;
case '+':
case '*':
case '/':
case '%':
case '-':
    printf("\n\t Arithmetic Operator ");
    break;
case '!':
    printf("\n\tLogical Operator");
    break;
case '&':
case '~':
case '^':
case '|':
    printf("\n\tBitwise Operator");
    break;
case '=':
    printf("\n\tAssignment operator ");
    break;
default:
    printf("\nInvalid Operator");
}
}
void main()
{
    char c;
    printf("\n Enter the operator :");
    scanf("%c",&c);
    operator(c);
}

No comments:

Post a Comment

Thank you for using this blog.