answersLogoWhite

0

#include<stdio.h>

#include<conio.h>

void main()

{

int n,i,r,count=0;

clrscr();

printf("Enter a number");

scanf("%d",&n);

for(i=2;i<n;i++)

{

r=n%i;

if(r==0)

{

count++;

break;

}

}

if(count==0 && n!=1)

{

printf("It is a Prime number");

}

else

{

printf("It is not a prime number");

}

getch();

}

User Avatar

Wiki User

12y ago

What else can I help you with?

Related Questions

Write a program number as a peimeter and checks whether it is perfect or not in java?

class perfect{public static void main(int n) // input as parameter{int a=0;for(int i=1;i


Write a c program using while loop to accept a number check and display message whether number is perfect or not?

The program is here guys.......... //Finding whether the given number is perfect or not //Starts here #include&lt;stdio.h&gt; void main() { int i=1,temp=0,number; scanf("%d",&amp;number); while(i&lt;=number/2){ if(number%i==0) temp+=i; i++; } if(temp==number) printf("Its a perfect number"); else printf("Its not a perfect number"); } //ends here


Could you write a assembly language program in tasm To check whether a given number present in a sequence of given memory location containing the string to be checked in 8086?

8086 assembly language program to check wether given number is perfect or not


What is a number that is odd and it's a perfect number?

It is unknown whether an odd perfect number actually exists. If an odd perfect number exists it will be extremely large, that is in excess of 10300.


Write a program By using if else statement to read a number and check whether it is positive or negative?

write a c++program by using if statement to read a number and check whether it is positive or negative


Is 495 a perfect number?

No, it isn't. In fact, it is not known whether are odd perfect numbers exist. The first perfect numbers are 6, 28, 496, and 8128.


How can I tell whether a number is a square number?

You can tell whether a number is a square number by looking at the last digit. A perfect square number ends with either 1, 4, 5, 6, 9 or 00.


Is 31 a perfect number?

No. The only perfect numbers less than 100 are 6 and 28. All known perfect numbers are even - it is unknown whether there are odd perfect numbers.


What are perfact numbers?

If the sum of all a number's factors (factors that are smaller than the number itself) is equal to the number itself, the number is said to be "perfect". For example, the factors of 6 (excluding 6 itself) are 1, 2, and 3; and the sum of these numbers is exactly 6. The smallest perfect numbers are 6, 28, 496, 8128. It isn't known whether the set of perfect numbers is finite or infinite. Also, it isn't known whether there are any odd perfect number; all known perfect numbers are even.


Make a C programming that displays the first four perfect numbers?

create a program that iterates until it finds a perfect number, then store that perfect number into an array. Continue iterating until you find three more. Then, you have an array of four perfect numbers.


Is 32 an almost perfect number?

Yes. The only known almost perfect numbers are the powers of 2. 32 = 2^5 is an almost perfect number. It has not yet been proved whether {x: x = 2^n for n in N} = {x: x is an almost perfect number}.


Whether frequent flyer number is same as skyward number?

Yes, Skyward is Emirates frequent flyer program.