Follow Our FB Page << >> for Daily Laughter. We Post Funny, Viral, Comedy Videos, Memes, Vines...

hello friends, given an expression we have to remove the
unwanted brackets in that expression.
Eg : (a+b) ---> a+b
(a+b)*(c)-----> (a+b)*c. Please mail me if you know
the logic. My mail id is :
Thank you in advance :-)

hello friends, given an expression we have to remove the unwanted brackets in that expression. Eg..

Answer / arjun

hello there,
the logic i quite simple and such questions are give just to
confuse us.

push the given string in a stack and while popping out
ignore the bracket PAIR which contain
i) a lone variable in between
ii) does not contain any operator before or after the bracket.

for eg. if (a+b)*c is there then bracket must not be ignored.


Is This Answer Correct ?    9 Yes 14 No

Post New Answer

More C++ Code Interview Questions

write a program that can LOCATE and INSERT elements in array using c++ programming languages.

0 Answers  


0 Answers  

swap prog

3 Answers   TCS,

What will be the output- for(i=1;i<=3;i++) { printf("%d",i); continue; i++; }

5 Answers   Impetus,

Deriving time complexity of Binary tree and AVL tree, step by step.

4 Answers   NetApp,

#include<iostream.h> //main() //{ class A { friend class B; public: void read(); }; class B { public : int a,b; }; void A::read() { cout<<"welcome"; } main() { A x; B y;; } In the above program......, as B is a friend of A B can have access to all members,i cant access . could you please tell me the reason and what would i code to execute this program?

2 Answers  

what is virtual constroctor ? give an exam for it?-(parimal dhimmar)

2 Answers  

Write a &#61521;(n) algorithm that sorts n distinct integers, ranging in size between 1 and kn inclusive, where k is a constant positive integer. (Hint: Use a kn-element array.)

0 Answers  

Create a program to read two random data set in two files named data1.txt and data2.txt manifold contains integer numbers, whereas data2.txt file contains the float type numbers. Simpanlahmasing each into 2 pieces of data that is an array of type integer array and an array of type float, then calculate the average numbers in the second array.

0 Answers  

main(){int a=5,b 10,c=2, d;a=b c;d=++a=(--c)*2; printf("%d%d%d%d,a,b,c,d; return o;}

1 Answers  

Write a program using one dimensional array that accept five values from the keyboard. Then it should also accept a number to search. This number is to be searched if it among the five input values. If it is found, display the message “Search number is found!” otherwise, display “Search is lost”. Example: Enter 5 numbers: 10 15 20 7 8 Enter number to search: 7 Search number is found!

2 Answers   College School Exams Tests,

write a program to sort 'n' elemnts using bubble sort

1 Answers   IBM,