Gate 2017 pyq C Programming | Consider the C program fragment below which is meant to divide x by y.
Автор: Gate CS pyqs - the other way [Eng]
Загружено: 2022-10-03
Просмотров: 1750
Описание:
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 greater_than_or_equal_to 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 greater_than 0 ) && ( r == x ) && ( y greater_than 0 )
(C) ( q == 0 ) && ( r == x ) && ( y greater_than 0 )
(D) ( q == 0 ) && ( y greater_than 0 )
Повторяем попытку...
Доступные форматы для скачивания:
Скачать видео
-
Информация по загрузке: