Answer:
Following are the program in the Python Programming Language.
#set the infinite while loop
while(True):
#get string input from the user
name=input()
#get integer input from the user
num=int(input())
#set the if statement to break the loop
if(num==0):
break
#otherwise, print the following output
else:
print("Eating {} {} a day keeps the doctor away.".format(num, name))
<u>Output</u>:
oranges
5
Eating 5 oranges a day keeps the doctor away.
apple
0
Explanation:
<u>Following are the description of the program</u>:
- Set the loop that iterates at infinite times and inside the loop.
- Declare two variables which are 'name' that get string type input from the user and 'num' that get integer type input from the user.
- Set the if conditional statement for break the infinite while loop.
- Otherwise, it prints the following output.
Answer:
The above code print the text at three times.
Explanation:
- It is because the above code has one loop which executes three times. The loop executes for the value of i = 0,1 and 10.
- when the value of i is 0 then "++i" will increase the value 1 and the text will be printed.
- If the value of i=1, then the value of i is 2 in the second iteration and the again the text is printed, then the if condition gives the true result and the value of i will be 10.
- Then the loop executes for the last time when the value of i is 10.Then the value will be 11 because of the increment operator and the text will be printed for the third time.
- Then the while loop is not true for the 11 value of i and the loop will get terminated.
Yes that is correct. Was there a specific question you wanted answered...
Answer:
Fault tolerance
Explanation:
Fault tolerance is the property that enables a system to respond to unexpected failures or system crashes while maintaining proper operation during the event of the failure of some of its components.
For( count = 50; count > 0; count-- )
System.out.println( count );