Question 8555 – TCP
December 20, 2023Question 17253 – NTA UGC NET JUNE 2023 Paper-1
December 21, 2023Question 3879 – UGC NET CS 2004 Dec-Paper-2
Consider the following statements,
int i=4, j=3, k=0;
k= ++i- – -j + i++ – – – j +j++;
What will be the values of i, j and k after the statement.
Correct Answer: C
Question 12 Explanation:
Given values are i=4, j=3 and k=0
Step-1: k= ++i- –j + i++ – –j +j++;
k= 5 – 2 + 5 – 1 + 1
k= (5-2)+(5-1)+1
= 3 + 4 + 1
= 8
Step-2: The value of i=6,j=2 and k=8
Step-1: k= ++i- –j + i++ – –j +j++;
k= 5 – 2 + 5 – 1 + 1
k= (5-2)+(5-1)+1
= 3 + 4 + 1
= 8
Step-2: The value of i=6,j=2 and k=8
7, 2, 8
5, 2, 10
6, 2, 8
4, 2, 8
Subscribe
Login
0 Comments