1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
koban [17]
2 years ago
10

Use a while loop to output the even number from 100 to 147? This is python

Computers and Technology
1 answer:
KiRa [710]2 years ago
7 0

Answer:

def main():

 i = 100

 while(i < 148):

   print(i)

   i += 2

main()

Explanation:

You might be interested in
Which of the following is a strategy used to enhance communication in a presentation?
Ann [662]
I believe the answer could be A
7 0
3 years ago
Write an Assembly program in MIPS that does the following:
hjlf

Answer:

see explaination

Explanation:

#DATA SECTION

.data

#Decalre x

x: .word 0

#declare y

y: .word 0

#Declare variables

choice: .space 1

#Store the repeat choice

op: .asciiz "C"

#Prompt

prompt1: .asciiz "\nEnter 2 integers:\n"

#Declare string for menu

menu: .asciiz "\nMenu \n 1. Addition\n 2. Subtraction \n 3. Multiplication \n 4. Division \nEnter your choice:"

#Declare string for repeat

repeat: .asciiz "\nDo u want to continue (C) or quit(Q):"

#Declare string for result

result: .asciiz "Result="

#Code section

.text

#main

main:

#label

continue:

#Load code to print string

li $v0, 4

#Load the base address of prompt1

la $a0, prompt1

#Print string

syscall

#Load code to read integer

li $v0, 5

#Read integer

syscall

#Store integer in x

sw $v0, x

#load code to read integer

li $v0, 5

#read integer

syscall

#Store in y

sw $v0, y

#Load code to print string menu

li $v0, 4

#Load address of menu

la $a0, menu

#Print string

syscall

#Load code to read integer

li $v0, 5

#Read integer

syscall

#Store the operation choice in $a1

move $a1, $v0

#Check user wishes to add

beq $a1, 1, addition

#Check user wishes to do subtraction

beq $a1, 2, subtraction

#Check user wishes to do multiplication

beq $a1, 3, multiplication

#Check user wishes to do division

beq $a1, 4, division

#Ask user for repetition

GetChoice:

#Load code to print string "repeat"

li $v0, 4

#Load address of repeat

la $a0, repeat

#Print string

syscall

#Load code to read character

li $v0, 12

#Read character

syscall

#Store character in choice

sb $v0, choice

#Load user choice

lb $t2, choice

#Load repeat option

lb $t3, op

#Check both

#If user wishes to continue, then go to continue

beq $t2, $t3, continue

#Else stop the program

j programEnd

#For addition

addition:

#load x

lw $t4, x

#load y

lw $t5, y

#Add

add $t6, $t4, $t5

#Load code to print result

li $v0, 4

#load result address

la $a0, result

#Print result

syscall

#load code to print integer

li $v0, 1

#load the value

move $a0, $t6

#print the integer

syscall

#Jump to get choice

j GetChoice

#For subtraction

subtraction:

#load x

lw $t4, x

#load y

lw $t5, y

#Add

sub $t6, $t4, $t5

#Load code to print result

li $v0, 4

#load result address

la $a0, result

#Print result

syscall

#load code to print integer

li $v0, 1

#load the value

move $a0, $t6

#print the integer

syscall

#Jump to get choice

j GetChoice

#For multiplication

multiplication:

#load x

lw $t4, x

#load y

lw $t5, y

#Add

mul $t6, $t4, $t5

#Load code to print result

li $v0, 4

#load result address

la $a0, result

#Print result

syscall

#load code to print integer

li $v0, 1

#load the value

move $a0, $t6

#print the integer

syscall

#Jump to get choice

j GetChoice

#Division

division:

#load x

lw $t4, x

#load y

lw $t5, y

#Add

div $t6, $t4, $t5

#Load code to print result

li $v0, 4

#load result address

la $a0, result

#Print result

syscall

#load code to print integer

li $v0, 1

#load the value

move $a0, $t6

#print the integer

syscall

#Jump to get choice

j GetChoice

#end

programEnd:

#loa dcode to stop the program

li $v0, 10

syscall

6 0
3 years ago
Write c++ program from 1to 100 to find prime numbers using statement.​​
olasank [31]

#include <iostream> using namespace std; int isPrimeNumber(int); int main() { bool isPrime; for(int n = 2; n < 100; n++) { // isPrime will be true for prime numbers isPrime = isPrimeNumber(n); if(isPrime == true) cout<<n<<" "; } return 0; } // Function that checks whether n is prime or not int isPrimeNumber(int n) { bool isPrime = true; for(int i = 2; i <= n/2; i++) { if (n%i == 0) { isPrime = false; break; } } return isPrime; }

5 0
3 years ago
What is the purpose of a register in a CPU? Describe three types of registers.
Ganezh [65]

Answer:

I hope this answer is correct

Explanation:

Internal registers include the instruction register (IR), memory buffer register (MBR), memory data register (MDR), and memory address register (MAR). The instruction register fetches instructions from the program counter (PC) and holds each instruction as it is executed by the processor.

5 0
3 years ago
How does a computer work?
Gre4nikov [31]

Answer:

A computer is a Device that can run multiple applications at a time and access the internet where you can find online stores and more also used to make video calls and more.

7 0
2 years ago
Read 2 more answers
Other questions:
  • Write a function (named n_pointed_star) to make the turtle draw an n-pointed star. The function should return nothing, and accep
    10·1 answer
  • Click _______ to view each individual record of a mail merge document.
    5·2 answers
  • Su
    6·1 answer
  • what is the first step you would take when troubleshooting an external network, such as an internet connection issue?
    13·2 answers
  • Xbrl taxonomy: is the document format used to produce web pages. is the final product (report. is a classification scheme. is a
    12·1 answer
  • Which of the following is considered a basic task in the context of computer operations? a. Connecting to the Internet b. Natura
    6·1 answer
  • If the signal is going through a 2 MHz Bandwidth Channel, what will be the maximum bit rate that can be achieved in this channel
    14·1 answer
  • Q.drtrdyudoijoemrkdf
    6·2 answers
  • True or False? Voice recognition is the process of determining the meaning of the words spoken by a human.
    7·1 answer
  • Create a defined name for range b6:e6 using walkup as the range name
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!