...
Question 6922 – UGC NET CS 2015 Dec – paper-3
April 14, 2024
Question 10439 – Programming
April 14, 2024
Question 6922 – UGC NET CS 2015 Dec – paper-3
April 14, 2024
Question 10439 – Programming
April 14, 2024

Question 10422 – Programming

What does the following code do?

 var a, b : integer;
 begin
    a:=a+b;
    b:=a-b;
    a:=a-b
 end; 

Correct Answer: A

Question 48 Explanation: 
Exchanges a and b.
Let us consider a=5; b=2
a := a+b = 5+2 = 7
b := a-b = 7-2 = 5
a := a-b = 7-5 = 2
O/P: a=2; b=5
A
exchanges a and b
B
doubles a and stores in b
C
doubles b and stores in a
D
leaves a and b unchanged
E
none of the above
0 0 votes
Article Rating
Subscribe
Notify of
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x
error: Alert: Content selection is disabled!!