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

Respuesta :

Answer:

is c

Explanation:

The important programming is as followed fr the . 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.

What is the integer?

An integer (suggested IN-tuh-jer) is an entire range (now no longer a fractional range) that may be positive, negative, or zero. Examples of integers are: -5, 1, 5, 8, 97, and 3,043. Examples of numbers that aren't integers are: -1.43, 1 3/4, 3.

  1. Importedjava.util.Scanner;
  2. public elegance PrimeClass consumer input
  3.   int range=sc.nextInt();//studying the range entered with the aid of using per Prime(range)}
  4.  non-public static void Prime(int range) zero
  5.    if(range<=2
  6.  System.out.println("zero top numbers much less than "+range);//due to the fact top numbers begin from 2 if the range is much less than 2 and we want to print top numbers much less than 2 so zero top number else.
  7. for(int i=2; zero)//the range need to now no longer be divisible with the aid of using every other range apart from with the aid of using the range itself so if the range is divisible with the aid of using any other range i'm breaking  
  8. if(count==zero)  System.out.print(i+" ");

     

Read more about the prime number :

https://brainly.com/question/145452

#SPJ2