Example #1
0
int main()
{
	struct infix q ;
	char expr[MAX] ;
//	clrscr() ;
	initinfix ( &q ) ;
	printf ( "\nEnter an expression in infix form: " ) ;
	gets ( expr ) ;
	setexpr ( &q, expr ) ;
	convert ( &q ) ;
	printf ( "The Prefix expression is: " ) ;
	show ( q ) ;
	getch( ) ;
}
Example #2
0
int main( )
{
    struct infix p ;
	char expr[MAX] ;
    initinfix ( &p ) ;
    printf ( "\nEnter an expression in infix form: " ) ;
	gets ( expr ) ;

	setexpr ( &p, expr ) ;
	convert ( &p ) ;

	printf ( "\nThe postfix expression is: " ) ;
	show ( p ) ;

    getch( ) ;
}