#include<stdio.h>
#include<iostream.h>
#include<conio.h>
#include<string.h>
#include<ctype.h>
void main()
{
int i=0,j=0,k=0,p[10];
char name[20];
char key[20]={'(',')','&','%','^','*','/','+','-','|',';'};
clrscr();
textcolor(2);
cprintf("---Operator Precedence-----\n");
cprintf("\nEnter the expression:");
scanf("%s",&name);
cprintf("\n---output----\n");
for(i=0;i<20;i++)
{
for(j=0;j<strlen(name);j++)
{
char c;
c=tolower(name[j]);
if(!isalpha(c)&&!isdigit(c))
{
if(key[i]==c)
{
printf("\n %c is executed %d(%c %c %c)\n",c,k++,tolower(name[j-1]),c,tolower(name[j+1]));
}
}
}
}
getch();
}
Not Satisfied ? Just search & get the result
Related posts:
- C program – Syntax Analyzer
- C++ program for overloading the unary operator ++.
- C Program to convert the lower case letters to upper case and vice-versa
- C++ program – Perform complex arithmetic using operator overloading
- C++ program – multiply two numbers without using multiplication operator
Tagged as:
C program for Operator Precedence,
Operator Precedence,
Operator Precedence using c program
Me, freelance system administrator having the qualification of Diploma in Electronics & Tele-communication + MCSE + CCNA + CST + 5 years of experience in IT field.
If you like This post, you can follow TheOnlineTutorials on Twitter.
Contact me Via email: support@theonlinetutorials.com
Subscribe to feed via Feed or EMAIL to receive instant updates.
Legal Disclaimer:All information found on the site is without any implied warranty of fitness for any purpose or use whatsoever. Content author/site administrator is not responsible for any loss occurred due to mistakes in this tutorial. Use this tutorial website at your own risk.