TCS Company Programming Arrays

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

Read Solution (Total 12)

TCS Other Question

Which among the following operator
has the right to left associativity?
1. Arithmetic
2. logical
3. Relational
4. Increment/Decrement
Predict the output of following code:
main()
{
int a=10,x;
x= a-- + ++a;
printf(“%d”,x);
}
1. 19 ​
2. 20​
3. 22
4. 23