Follow

Translate

Friday, April 29, 2016

Program to convert an Expression from Infix to Postfix

#include<stdio.h>
#include<stdlib.h>

#define MAXCOLS 80
#define TRUE 1
#define FALSE 0

void postfix(char*, char *);
int isoperand(char);
void popandtest(struct stack*, char*, int*);
int prcd(char, char);
void push(struct stack*, char);
char pop(struct stack*);


void main(){
char infix[MAXCOLS];
char postr[MAXCOLS];
int pos = 0;

while ((infix[pos++] = getchar()) != '\n' );
infix[--pos]='\0';
printf("%s%s", "the original infix expression is", infix);
postfix(infix, postr);
printf("%s\n", postr);
}   /* end of main */
If You want to learn about the technology, computer science & engineering, web programming, freelancing, earning please click here :CSE SOLVE

0 comments:

Post a Comment

Google+ Followers