15950 0
Program for Matrix multiplication in C (With & Without pointers)
This article provide you working code sample for matrix multiplication in C using pointers and without using pointers, both ways are explained.
Type
Article
17549 1
Star program in C (Pyramid pattern program examples)
This article will help you create and explains the code to print various pyramid pattern program in C language or you can star pattern program in C
Type
Article
8232 0
Fibonacci Series program in C ( With and Without recursion)
In this article, I have provided algorithm to understand about fibonacci series and how to create a program for fibonacci in C.
Type
Article
2489 0
Introduction to C++ File handling
In this article, we have provided how to do basic file handling operations in C++ using ifstream and ofstream.
Type
Article
4570 0
Program to check if input is int or float in C
In this article, I have provided sample C programming code to check if a given input is int or float data type in C
Type
Article

12945 0
Simple C programming examples with output (must read for beginners)
This article gives you various useful simple C programs code with output, which is a useful & a must read list of basic C programs for beginners
Type
Article
1292 0
C Program to print Fibonacci Triangle
Fibonacci Series is one of the most asked questions in Tech Interviews. Here, I have attempted to simplify the explanation with the help of an example.
Type
Article
3073 0
File program in C (Open, Read and Write)
In this article, I have provided working examples of file opening, reading and writing using C programming language.
Type
Article
2056 1
Want to convert infix to postfix in C but getting error empty stack

I write a C code to convert infix expression to postfix expression. The expression may include '^' , "+", "-" , "/", "*" and all three types of brackets i.e." ({[ ". The code should first check whether the brackets are balanced or not and then do the conversion. But the code is showing an empty stack at the output.

Here is my sample code

...
Type
Question
1457 1
Can anybody help me to convert a infix expression into a postfix expression which deals with all three brackets i.e. ({[ in c language?

This is the pseudo code. Create a function that takes an infix expression as input and converts it to a postfix expression. It should  

take pointers to two strings as input; one containing the infix expression, and second to which this

function will write the postfix expression i.e. the declaration should be

void infixToPostfix(char *infix, char *postfix, int str_size);

The algorithm is as follows:

Iterate over the infix expression’s string. For each character c,

• If c is an operand, concatenate it with the postfix expression.

• If c is an operator, check if top of stack, say m, is an operator. If so, check if the operator

precedence of m is higher or equal to the operator precedence of c; if yes, concatenate m with

postfix expression, and pop it from the stack. Keep doing this until the top of stack is not an

operator with operator precedence higher or equal to the operator precedence of c. Then push

c on the stack.

• After completely processing input expression, TopAndPop remaining operators from stack and

concatenate each with postfix expression, in the order they are popped.

You can perform string concatenation using strcat().

...
Type
Question

Page 2 of 4