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
315 views
in Data Types and Operators by (32.9k points)
closed by

Considering the following C++ statements. 

Fill up the blanks 

i) If p=5 and q=3 then q%p is...... 

ii) If E1 is true and E2 is False then E1 && E2 will be........ 

iii) If k=8, ++k <= 8 will be = ........ 

iv) If x=2 then (10* ++x) % 7 will be ....... 

v) If t=8 and m=(n=3,t-n), the value of m will be ....... 

vi) If i=12 the value i after execution of the expression i+=i– + –i will be ........

1 Answer

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

i) 3 

ii) False 

iii) False(++k makes k=9. So 9<=8 is false) ‘

iv) 2(++x becomes 3 ,so 10 * 3 =30%7 =2) 

v) 5( here m=(n=3,8-3)=(n=3,5), so m=5, The maximum value will take) 

vi) Here i=12 

i + = i– + -i 

here post decrement has more priority than pre decrement. 

So i– will be evaluated first. Here first uses the value then change so it uses the value 12 and i becomes 11 

i + =12 + –i 

now i =11. 

Here the value of i will be changed and used so i~ becomes 10. 

i — = 12 + 10 

= 22 

So i =22+10 

i =32 

So the result is 32.

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.

...