Professional Documents
Culture Documents
Dsu T
Dsu T
AFFILIATED TO M.S.B.T.E.
Evolution sheet for Micro Project
Name and
Signatur MR ANIL
e of
faculty
MAULANA AZAD POLYTECHNIC , SOLAPUR
CERTIFICATE
This is a bonafide work carried out by above students, under the guidance of MR
ANIL and it is submitted towards the fulfillment of requirement of MSBTE, Mumbai for
the award of Diploma Computer Engineering at MAULANA AZAD POLYTECHNIC ,
SOLAPUR during the academic year 2023-2024.
(MR ANIL)
Guide
(Ms.Asma Tamboli) (Mr.S.N.Shah)
HOD Principal
Place:
Date:
Overview
One of the applications of Stack is in the conversion of arithmetic
expressions in high-level programming languages into machine
readable form. As our computer system can only understand and work
on a binary language, it assumes that an arithmetic operation can take
place in two operands only e.g., A+B, C*D,D/A etc. But in our usual
form an arithmetic expression may consist of more than one operator
and two operands e.g. (A+B)*C(D/(J+D)).
#include <stdio.h>
#include <stdlib.h> /* for exit() */
#include <ctype.h> /* for isdigit(char ) */
#include <string.h>
if (top < 0) {
printf("stack under flow: invalid infix
expression");
getchar();
/* underflow may occur for invalid expression */
/* where ( and ) are not matched */
exit(1);
}
else {
item = stack[top];
top = top - 1;
return (item);
}
}
i = 0;
j = 0;
item = infix_exp[i]; /* initialize before loop*/
return 0;
}
Output:-
First Run:
Enter Infix expression : A+(B*C-(D/E^F)*G)*H
Postfix Expression: ABC*DEF^/G*-H*+
Second Run:
Enter Infix expression : (3^2*5)/(3*2-3)+5
Postfix Expression: 32^5*32*3-/5+