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
bonufazy [111]
3 years ago
13

Write c++ program from 1to 100 to find prime numbers using statement.​​

Computers and Technology
1 answer:
olasank [31]3 years ago
5 0

#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; }

You might be interested in
Enter a formula or in sales G5 the calculate the difference between the attendance totals for 2018 and 2017
goldfiish [28.3K]

we will write year in column B and column c respectively

2017 and 2018

then we will add months of year from January to December in the cells range from A2 to A13

then we will choose cell g5 and will write the diffrence formula

g5=attendance of 2018 - attendance of 2017"

we put "=" sign to put an formula in excel

then finally we will use fill handle and drag it from g6 to g12

to copy the difference  formula

look at attached file

Download xlsx
4 0
3 years ago
What is the new subnet mask in prefix format?
vodomira [7]

In the case above, the the new subnet mask in prefix format is seen in IPv6 and in IPv4.

<h3>What is subnet prefix mask?</h3>

A lot or a single computer that is known to be linked to a subnet is said to shares a kind of an identical part of the IP address.

Note that this shared information is said to be called the  routing prefix, and in IPV4 (Internet Protocol Version 4), the routing prefix is said to be called a subnet mask.

Hence, The the new subnet mask in prefix format is seen in IPv6 and in IPv4 because that is the format that it always comes in.

Learn more about subnet from

brainly.com/question/8907973

#SPJ1

3 0
2 years ago
In a new blank word document you can typing where ?
djyliett [7]
In the document...? Not sure what the question is.
8 0
3 years ago
Assume that the int variables i, j and n have been declared, and n has been initialized. Write code that causes a "triangle" of
makvit [3.9K]

Answer:

The code that will cause the triangle of  asterisks is given by;

for (i=1; i<=n; i++){

for (j=1; j<=i; j++)

cout << "*";

cout << "\n";

}

Explanation:

6 0
4 years ago
Which of the following devices is used to connect multiple devices to a network and sends all traffic to all connected devices?
Stels [109]

Answer: HUB

Explanation:

A Hub is a network device, that acts only in layer 1 (Physical layer) forwarding all traffic that reaches to the input port, to all output ports at once, without processing the received data in any way that could modify them.

It behaves like it were a multiport repeater (which has only one output port).

5 0
3 years ago
Other questions:
  • Why would you use a database system instead of traditional file system
    6·1 answer
  • Which is a type of display monitor? HDD CPU SSD LCD
    6·1 answer
  • Cual es la definición de grouded ​
    7·2 answers
  • What is the default view in a Word document?
    10·2 answers
  • When trying to work efficiently, how should you prioritize your tasks? (Site 1)
    8·1 answer
  • How many characters should a strong password have? four six eight ten
    10·2 answers
  • Write a function solution that, given an integer N, returns the maximum possible
    8·1 answer
  • What is the most popular type or method of guaranteed reservation where booking transactions will be charged automatically?
    7·1 answer
  • Assume that processor refers to an object that provides a void method named process that takes no arguments. As it happens, the
    7·1 answer
  • Java
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!