Answer & Explanation:
To print 10 on a line and each number separated by space; you make the following modifications.
print(str(i)+" ",end=' ')
str(i)-> represents the actual number to be printed
" "-> puts a space after the number is printed
end = ' ' -> allows printing to continue on the same line
if(count == 10):
print(' ')
The above line checks if count variable is 10;
If yes, a blank is printed which allows printing to start on a new line;
The modified code is as follows (Also, see attachment for proper indentation)
count = 0
for i in range(100,201):
if(i%6 == 0 and i%5!=0) or (i%5 ==0 and i%6!=0):
print(str(i)+" ",end=' ')
count = count + 1
if(count == 10):
print(' ')
count = 0
Answer:
Control unit
Explanation:
central Processing unit has two components which include: Arithmetic and Logic Unit (ALU) that perform arithmetic and logical operation and Control Unit (CU) which fetches instructions from memory and decodes as well executes them
Answer:
Following are the program to this question:
#include <stdio.h>//using the header file
int main()//main method
{
int y;//defining integer variable y
printf("Enter year value:");//print message
scanf("%d", &y);//use input method for input year value
if (y>= 2101)//defining if block that checks year greater then 2101
printf("Distant future");//print message
else if (y>= 2001)//defining else if block that checks year greater then 2001
printf("21st century"); //print message
else if (y>= 1901)//defining else if block that checks year greater then 1901
printf("20th century");//print message
else //defining else block
printf("Long ago");//print message
return 0;
}
Output:
Enter year value:1998
20th century
Explanation:
In the given C language code, inside the main method, an integer variable "y" is defined, which allows the user to input the year value, and use the multiple conditions to check the given value and print message when the condition is matched.
- Inside the "if" condition block, it checks the "y" variable value is greater and equal to 2101. so, it will print "Distant future", otherwise go to the next condition.
- In this, if "y" value is greater than equal to "2001", it will print the message "21st century", otherwise go to the next condition.
- In this, If the value of "y" is greater than equal to "1901", it will print the message "20th century", and if all the above condition is not true, then it will go to the else block, and it will print "Long ago" as the message.
Answer:
=B3 / 4
Explanation:
The price of a packet of grated cheese is $2.60. To make pizza, this packet of cheese is divided into four to make 1 pizza. Therefore, the price of the grated cheese used to make 1 pizza = price of packet of cheese / 4 = $2.60 / 4 = $0.65
This price is the price inserted in cell D3. The price for each packet of grated cheese is inserted in cell B3.
Therefore the formula used in cell D3 to find the price of each grated cheese required for one pizza is:
Formula for D3 is "=B3 / 4"