filmov
tv
Programming Language GATE-2017 Problem Solution

Показать описание
Consider the C program fragment below which is meant to divide x by y using repeated subtractions. The variable x, y, q and r are all unsigned int.
while(r greaterThan= y)
{
r = r - y;
q = q + 1;
}
Which of the following conditions on the variables x, y, q and r before the execution of the fragment will ensure that the loop terminates in a state satisfying the condition x == (y*q + r)?
(A) ( q == r ) && ( r == 0)
(B) ( x greaterThan 0 ) && ( r == x ) && ( y greaterThan 0 )
(C) ( q == 0 ) && ( r == x ) && ( y greaterThan 0 )
(D) ( q == 0 ) && ( y greaterThan 0 )
GATE CSE 2017 Set 2 | Question: 37
Switch Case Control Statements In C Tutorial in Hindi
Switch statement in C programming | What is switch case?
Conditionals (Switch) in Hindi
Pass by Value VS Pass by Reference
Call By Value and Call By Reference in C
Pass by Value | Pass by Reference
Variable in C programming in hindi | what is variable? Types of Variables in c in hindi
Variables & Data Types In C
Variables in C Programming | Programming in C
Introduction to Variables in C
Variables in C | C Language Tutorial
Arrays In C
Arrays in C | Introduction to Arrays
Arrays & Pointers in C
Array in C language
Pointers In C
Arrays & Pointers in C
Introduction to Pointers in C
Strings In C: C Tutorial In Hindi
Strings in C - part 1 | C programming tutorials
Strings in C
Strings in C Programming | Concept of Strings in C Programming
Recursion in C
Recursion in C | Introduction to Recursion
Recursive Functions: Recursion In C
Recursion in C | Recursive function in c programming
GATE CSE Preparation Strategy | Computer Science Preparation Strategy
How to Prepare for GATE CSE
GATE CSE Videos | GATE CSE PYQs Solution
GATE CSE Tips and Tricks
How I cracked GATE exam | Preparation strategy for GATE exam
How to Crack GATE Exam in First Attempt
How to Prepare For GATE Without Coaching
How to Crack GATE Exam Without Coaching
GATE Exam Preparation Strategy
How to Crack GATE by Self Study
Improve Score in GATE | Crack GATE Tricks
Benefits of GATE EXAM | How to PREPARE WITH or WITHOUT Coaching
#computerscience #computerscienceengineering #computersciencemcqs #computersciencevideos #gate #gateexam #gatecse #gatecomputerscience #gatecs #gatecsit #gate2011 #gate2023 #gate2023classes #gate2023preparation #gatepyqs #gatepyq #gatetips #gatetricks #gatepreparation #gateprepdaily #gatepreparationstrategy #gatepreviousyearquestions #gateprevioussolvedquestions #gatestrategy #gateexamprep #crackgateexam #crackgate #shortcut #shortcuts #shortcutsforstudents #shortcutvideo #btech #btechcse #btechit #bca #mca #kshitijsahu #gateq #datastructure #datastructures #datastructureandalgorithm #datastructuresandalgorithms #datastructureandalgorithms #algorithm #algorithms #designandanalysisofalgorithms #programming #programminglanguage #programminginhindi #programmer #clanguage #clanguageprogramming #programminglanguages #programminglanguages2020 #programminglanguages2021 #array #arrays #arraysinc #recursion #functioninc #pointersinc #callbyreference #callbyvalue #string #strings #forloop #forloops #gate2017
while(r greaterThan= y)
{
r = r - y;
q = q + 1;
}
Which of the following conditions on the variables x, y, q and r before the execution of the fragment will ensure that the loop terminates in a state satisfying the condition x == (y*q + r)?
(A) ( q == r ) && ( r == 0)
(B) ( x greaterThan 0 ) && ( r == x ) && ( y greaterThan 0 )
(C) ( q == 0 ) && ( r == x ) && ( y greaterThan 0 )
(D) ( q == 0 ) && ( y greaterThan 0 )
GATE CSE 2017 Set 2 | Question: 37
Switch Case Control Statements In C Tutorial in Hindi
Switch statement in C programming | What is switch case?
Conditionals (Switch) in Hindi
Pass by Value VS Pass by Reference
Call By Value and Call By Reference in C
Pass by Value | Pass by Reference
Variable in C programming in hindi | what is variable? Types of Variables in c in hindi
Variables & Data Types In C
Variables in C Programming | Programming in C
Introduction to Variables in C
Variables in C | C Language Tutorial
Arrays In C
Arrays in C | Introduction to Arrays
Arrays & Pointers in C
Array in C language
Pointers In C
Arrays & Pointers in C
Introduction to Pointers in C
Strings In C: C Tutorial In Hindi
Strings in C - part 1 | C programming tutorials
Strings in C
Strings in C Programming | Concept of Strings in C Programming
Recursion in C
Recursion in C | Introduction to Recursion
Recursive Functions: Recursion In C
Recursion in C | Recursive function in c programming
GATE CSE Preparation Strategy | Computer Science Preparation Strategy
How to Prepare for GATE CSE
GATE CSE Videos | GATE CSE PYQs Solution
GATE CSE Tips and Tricks
How I cracked GATE exam | Preparation strategy for GATE exam
How to Crack GATE Exam in First Attempt
How to Prepare For GATE Without Coaching
How to Crack GATE Exam Without Coaching
GATE Exam Preparation Strategy
How to Crack GATE by Self Study
Improve Score in GATE | Crack GATE Tricks
Benefits of GATE EXAM | How to PREPARE WITH or WITHOUT Coaching
#computerscience #computerscienceengineering #computersciencemcqs #computersciencevideos #gate #gateexam #gatecse #gatecomputerscience #gatecs #gatecsit #gate2011 #gate2023 #gate2023classes #gate2023preparation #gatepyqs #gatepyq #gatetips #gatetricks #gatepreparation #gateprepdaily #gatepreparationstrategy #gatepreviousyearquestions #gateprevioussolvedquestions #gatestrategy #gateexamprep #crackgateexam #crackgate #shortcut #shortcuts #shortcutsforstudents #shortcutvideo #btech #btechcse #btechit #bca #mca #kshitijsahu #gateq #datastructure #datastructures #datastructureandalgorithm #datastructuresandalgorithms #datastructureandalgorithms #algorithm #algorithms #designandanalysisofalgorithms #programming #programminglanguage #programminginhindi #programmer #clanguage #clanguageprogramming #programminglanguages #programminglanguages2020 #programminglanguages2021 #array #arrays #arraysinc #recursion #functioninc #pointersinc #callbyreference #callbyvalue #string #strings #forloop #forloops #gate2017