Computer Science, asked by botno1starmaker, 1 day ago

input a number check number is prime number or not while loop (computer program)​

Answers

Answered by ᏢerfectlyShine
5

Answer:

Before going to the program for Prime Number or Not first let us understand what is a Prime Number?

Prime Number:

                 A Prime Number is a number greater than 1 and which is only divisible by 1 and the number itself.

For example,

                17 is a Prime Number, because 17 is not divisible by any number other than 1 and 17.

To find whether a Number is Prime Number or Not it is enough to check whether ‘n’ is divisible by any number between 2 and √n. If it is divisible then ‘n’ is not a Prime Number otherwise it is a Prime Number.

Answered by pritp404
3

Explanation:

Write C++ program to check whether a number is Prime number or not using while loop

#include <math.h>

{

int num, i, f;

//Reading a number from user.

cout<<"Enter any number:";

cin>>num;

f = 0;

i = 2;

hope it helps you

OR

<!DOCTYPE html>

<html>

<head>

<title>Page Title</title>

</head>

<body>

<h1>This is a Heading</h1>

<p>This is a paragraph.</p>

Similar questions