October 20, 2023
October 21, 2023
October 20, 2023
###### NTA-UGC-NET 2021 Dec & 2022 June Paper-1
October 21, 2023
 Question 311
What is the value of ‘b’ after the execution of the following code statements :

c=10;

b=+ +c+ + +c;

 A 20 B 22 C 23 D None
Question 311 Explanation:
It will give error message because they are not given in proper syntax.
Suppose when we are taken (++c)+(++c);
→ It will give result 23 because pre/post increment will evaluate from right to left.
(++c)+(++c); /* It will increment by one. It means 11 */
(++c)+(++c); /* Before c=11 and now we are incrementing by 1. It will become 23. */
Question 311 Explanation:
It will give error message because they are not given in proper syntax.
Suppose when we are taken (++c)+(++c);
→ It will give result 23 because pre/post increment will evaluate from right to left.
(++c)+(++c); /* It will increment by one. It means 11 */
(++c)+(++c); /* Before c=11 and now we are incrementing by 1. It will become 23. */
Article Rating
Subscribe
Notify of