TCS Company Programming

Which among the following operator
has the right to left associativity?
1. Arithmetic
2. logical
3. Relational
4. Increment/Decrement

Read Solution (Total 3)

TCS Other Question

Predict the output of following code:
main()
{
int var=20;
// scope of the local variable is within function or block
printf(“%d,”,var); //outer block
{
int var=30;
//Inner block
printf(“%d”,var);
}
}

1. Error
2. 20,30
3. 20,20
4. Garbage value
Predict the output of following code:
main()
{
int x,a=10;
x=9*5+​ 7/3​ -6+a; ​ //45+2-6+10 = 51 ​ // 7/3 =2 int division
printf(“%d”,x);
}
1. 51
2. 51.5
3. 31
4. None of these