answersLogoWhite

0

Is 51 a prime num

Updated: 11/4/2022
User Avatar

Wiki User

12y ago

Best Answer

51 is not a Prime number as it is divisible by 3. A prime number has only 2 factors which are 1 and itself. Composite numbers are every other positive integer except 1 and 0. 1 and 0 are neither prime, nor composite.

User Avatar

Wiki User

12y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Is 51 a prime num
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

How do you write a program that prints out the first 100 prime numbers using OOP?

You do not need OOP for this because the first 100 prime numbers are all integral types. All you need is a function to determine if a given integral is prime or not, and another to find the next prime after a given integral: bool is_prime (const unsigned int num) { unsigned factor, max_factor; /* anything less than 2 is non-prime */ if (num<2) return false; /* 2 is the only even prime */ if (!(num%2) return num==2; /* determine largest potential factor of num (square root of num)*/ max_factor = sqrt (num); /* test each odd factor from 3 onwards */ for (factor=3; factor<=max_factor; factor+=2) { if (!(num%factor)) return false; /* num is non-prime */ } return true; /* the number is prime */ } unsigned next_prime (unsigned int num) { /* increment num until num is prime */ while (!is_prime (++num)); return num; } /* test the functions */ int main (void) { unsigned num, count; count=0; num=0; printf ("Printing the first 100 prime numbers:\n"); while (count<100) { num=next_prime (num); printf ("%d is prime\n", num); ++count; } return 0; }


Is 39 an prime num?

No.


Write a unix shell program to print the prime numbers?

i=2 rem=1 echo "Enter a number" read num if [ $num -lt 2 ] then echo "$num is not prime" exit 0 fi while [ $i -le `expr $num / 2` -a $rem -ne 0 ] do rem=`expr $num % $i` i=`expr $i + 1` done if [ $rem -ne 0 ] then echo "$num is prime" else echo "$num is not prime" fi


How do you write a C program to check whether a number is prime or not and to find the nth prime number?

int number; int i=2; while (i<number) { if(number%i==0) { printf("Not a prime no."); break; } else printf("number entered is prime"); getch(); }


How do you write a C program to generate the first 50 prime numbers?

/*Determine prime numbers between 1 to 50*/ #include<stdio.h> #include<conio.h> main() { int num, i ,n; clrscr(); printf ( "\nEnter a number limit" ) ; scanf ( "%d", &n ) ; for ( num=2; num <= 50; num++ ) { for ( i=2; i <= num - 1; i++ ) { if ( num % i == 0 ) { Break; continue; } } if (num==i) printf(\n The prime number=%d", num); continue; } getch() }


Is 73 a prime num?

Yes, 73 is a prime number.


Shell script to find a prime no?

i=2 rem=1 echo -e "Enter a number: \c" read num if [ $num -lt 2 ]; then echo -e "$num is not prime\n" exit 0 fi while [ $i -le `expr $num / 2` -a $rem -ne 0 ]; do rem=`expr $num % $i` i=`expr $i + 1` done if [ $rem -ne 0 ]; then echo -e "$num is prime\n" else echo -e "$num is not prime\n" fi


Write a program that computes and prints X-th prime number where X equals 125 plus 20?

#include#includebool is_prime(unsigned num) {unsigned max, factor;if (num


How do you write a c program to find prime numbers between 1 to 10000 using functions?

You need two utility functions. The first determines if a given number is prime or not. The second finds the next prime after a given number. The following function can be used to determine if a given integer is prime: bool is_prime (const unsigned num) { if (num<2) return false; if (0==(num%2)) return num==2; unsigned max_factor = (unsigned) sqrt ((double) num) + 1; unsigned factor; for (factor=3; factor<max_factor; ++factor) if (0==(num%factor)) return false; return true; } The following function can be used to determine the next prime after the given integer: unsigned next_prime (unsigned num) { while (!is_prime (++num)); return num; } Now you can print a series of primes using the following: int main (void) { unsigned num=1; while (num<10000) { num = next_prime (num); printf ("%d is prime\n", num); } return 0; }


Is 51 prime?

No, 51 is not prime. 51's factors are 1, 3, 17, and 51. 17*3=51.


Is 5 a prime num ber?

YES 5 is a prime number!


How do you write a program in lisp to find if a number is prime or not?

(defun prime (num) (if (< 2 num) (do ((dividend 2 (1 + dividend)) (chk-to (sqrt num))) ((equal (rem num dividend) 0)) (when (<= chk-to dividend) (return t))) t))