Use app×
Join Bloom Tuition
One on One Online Tuition
JEE MAIN 2025 Foundation Course
NEET 2025 Foundation Course
CLASS 12 FOUNDATION COURSE
CLASS 10 FOUNDATION COURSE
CLASS 9 FOUNDATION COURSE
CLASS 8 FOUNDATION COURSE
0 votes
1.7k views
in Specification and Abstraction by (49.1k points)
closed by

What are the values of variables m and n after the assignments in line (1) and line (3)?

1. m, n : = 2, 5 

2. – – m, n = ?, ? 

3. m,n: = m + 3, n – 1 

4. – – m, n = ?, ?

1 Answer

+1 vote
by (54.8k points)
selected by
 
Best answer

The assignment in line (1) stores 2 in variable m, and 5 in variable n.

The assignment in line (3) evaluates the expressions m + 3 and n – 1 using the current values of m and n as

m + 3 , n – 1

= 2 + 3, 5 – 1

= 5, 4

and stores the values 5 and 4 in the variables m and n, respectively.

1. m, n : = 2, 5 

2. – – m, n = 2, 5 

3. m, n : = m + 3, n – 1 

4. – – m, n = 2 + 3, 5 – 1 = 5, 4

Values of the variables after the two assignments are shown in line (2) and line (4).

Welcome to Sarthaks eConnect: A unique platform where students can interact with teachers/experts/students to get solutions to their queries. Students (upto class 10+2) preparing for All Government Exams, CBSE Board Exam, ICSE Board Exam, State Board Exam, JEE (Mains+Advance) and NEET can ask questions from any subject and get quick answers by subject teachers/ experts/mentors/students.

...