TCS Company Programming Puzzles

Find Prefix and Postfix for the below Infix problem statement:

Infix Expression: 11 + 20/5* (20 - 15)^6^5

A. Prefix Expression: 11 20 15 20 5 - ^^*6 5/+
Postfix Expression: +20 / 11 * 5 - 20 ^^15 6 5
B. Prefix Expression: 11 20 5 20 15 - 6 5^^*/+
Postfix Expression: +11 / 20 * 5^^ - 20 15 6 5
C. Prefix Expression: 11 20 5 20 15 - ^^*/+6 5
Postfix Expression: +11 /^^-20 * 5 20 15 6 5
D. Prefix Expression: +11/20 * 5^^ - 20 15 6 5
Postfix Expression: 11 20 5 20 15 - 6 5^^*/+

Read Solution (Total 7)

TCS Other Question

When we execute the given code after giving input, which output is displayed?

int main()
{
int a, b, c;
printf("Enter value of a & bn");
c = scanf("%d",&a,&b);
printf("%d",c);
getch():
return 0;
}
Find the minimum number of arithmetic operations required to evaluate below expression

f(P) = 8P^3 + 3P +12

Note - for a given value of P using only one temporary variable.