...
Computer-Networks
December 20, 2023
NTA UGC NET JUNE 2023 Paper-1
December 21, 2023
Computer-Networks
December 20, 2023
NTA UGC NET JUNE 2023 Paper-1
December 21, 2023

UGC NET CS 2004 Dec-Paper-2

Question 12
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.
A
7, 2, 8
B
5, 2, 10
C
6, 2, 8
D
4, 2, 8
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
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

Leave a Reply

Your email address will not be published. Required fields are marked *