Ask the use if they want a cup of tea. If they replay with “no” or “n” repeat the question. Once the loop stops display the message “Sorry,we have run out of tea”
Ask the user to input a number and then ask if they want to double the number. If they answer “y”multiply the number by 2 and display the answer. Keep repeating this loop, doubling their number each time, until they no longer reply “y”.
Average of the given numbers
Looping problem:-
Input two positive integers a and b from the user. Determine the remainder of a/b. Assume that the division and modulus operators are not available.
Looping problem:-
Input two positive integers a and b from the user. Determine the integer quotient of a/b. Assume that the division operator is not available.
Looping problem:-
Write an if-else statement that outputs the word "Warning" provided that either the value of the variable temperature is greater than or equal to 100, or the value of the variable pressure is greater than or equal to 200, or both. Otherwise, the if-else statement outputs the work "OK".
Three numbers denoted by the variables A, B and C are supplied as input data. Print these three numbers in ascending order.
Looping problem:
Multiply a number with the sum of its digits.
Input a number and display that how many digits it has.
The value of a%b is 3 and the value of b%a is 1 as the smallest of the two is 1 so the out putbe 1
Sample output
3
7
Sampleinput
1