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
geniusboy [140]
3 years ago
5

A prime number is an integer that is divisible only by 1 and by itself. Write a program that: 1. Takes a number as an input. 2.

Prints back to the console all the primes that are larger than 1 but not larger than the number that has been entered. You need to have a procedure called isPrime. You may have more procedures if you like. 1. This procedure receives a number through one of the registers. 2. Checks if this number is prime. 3. Returns back through one of the registers to the main program 1, if the number is prime, 0 otherwise. sample run: Please enter a number: 44 Primes found until the given number: 2 3 5 7 11 13 17 19 23 29 31 37 41 43 Press any key to continue .
This is an assembly language assignment. The first they want me to write as c++ and I write it and then I have to translate into the assembly. How I can do that?
This is the code as c++
include Irvine32.inc

.data
string1 "Please enter a number:"
string2 "Primes found until given number:"

.code
main Proc
#include
using namespace std;
bool isPrime(int num);
int main()
{
int num;
bool val;
cout<<"enter a number";
cin>>num;
val=isPrime(num);
if(val==true)
cout<<"It is a prime Number";
else
cout<<"It is not a prime number";
return 0;
}
bool isPrime(int num)
{
int i,count=0;
for(i=2;i<=num;i++){
if(num%i==0)
count++;
}
if(count==2)
return true;
else
return false;
}

exit
main endp
end main
Computers and Technology
1 answer:
Alexandra [31]3 years ago
8 0

Answer:

is c

Explanation:

You might be interested in
True / False<br> The architecture of a computer determines its machine language.
ozzi

Answer: True

Explanation:

The architecture of the computer determine the processor and it determines whether we will have fixed length instructions or variable length instructions.

We have CISC and RISC architectures which uses different types of instructions and the data are processes in different machine languages.

6 0
3 years ago
Which type of game controller has a set of controls for each hand?
svet-max [94.6K]
If you play the Wii, they have the controller and then they have a nunchuck that connects to the other controller, and you use that with your other hand. Hope that helps :)
6 0
3 years ago
What is the binary conversion of 179.187.223.21?
Lemur [1.5K]

Explanation:

I hope its the correct answer i'm not sure!

6 0
3 years ago
Read 2 more answers
Most P2P apps or services provide safety and privacy features such as verification of payment amount before payment is sent, a u
Vesna [10]

Most peer-to-peer (P2P) apps or services provide safety and privacy features such as <u>onetime password (OTP)</u>.

<h3>What is P2P service?</h3>

P2P service is an abbreviation for peer-to-peer (P2P) service and it can be defined as a decentralized platform through which two (2) individuals or business firms interact with each other directly, without any third-party or an intermediary  being involved.

Generally, most peer-to-peer (P2P) applications or services provide safety and privacy features to customers such as:

  • Verification of payment amount before payment is sent.
  • A user PIN
  • The use of a onetime password (OTP).

Read more on P2P here: brainly.com/question/26190446

8 0
2 years ago
Write a program in pascal to find the area of a circle
umka2103 [35]

Program Area_Circle;

Uses Crt;

Const

Pi = 3.1416;

Var

Radius : Integer;

Area : Real;

Begin

Clrscr;

Writeln('Area of a Circle Solver');

Writeln;

Write('Enter the Radius of the Circle : ');

Readln(Radius);

Area := (Pi * Radius * Radius);

Writeln;

Writeln('The Area of the Circle is ' ,Area:8:2,'.');

Writeln;

Writeln('Program Executed');

Readln;

End.

Hope this helps!

5 0
4 years ago
Other questions:
  • Which of the following represents the bus topology? Multiple Choice All devices are connected to a central device, called a hub.
    8·1 answer
  • Hi can yall tell me if my answers r right or wrong and if they are can u tell which ones r correct. And plz explain only if you
    14·1 answer
  • An online service provider provides its users with hosted computers, an operating system, and a database management system (DBMS
    12·1 answer
  • My programming lab 9.2 C++ Write a full class definition for a class named Counter, and containing the following members:_______
    6·1 answer
  • If you have a document that is relevant to more than one folder in your computer what should you do?
    8·1 answer
  • The ________ component of the five-component framework of an information system includes individuals who maintain the data and s
    5·1 answer
  • 3.6 code practice (edhesive)
    8·1 answer
  • List two major problems that could be addressed by futuring.
    15·1 answer
  • What is the name of tool
    11·1 answer
  • A file can be safed with a different file name then it currently has by clicking on save ? in the file tab
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!