Write a program to find if entered number is prime or not
Answers
Answered by
4
Answer:
The program output is also shown below.
* C program to check whether a given number is prime or not.
* and output the given number with suitable message.
#include <stdlib.h>
int num, j, flag;
printf("Enter a number \n");
scanf("%d", &num);
if (num <= 1)
printf("%d is not a prime numbers \n", num);
Answered by
0
Class XYZ
(public static void main string args [ ] )
{
int a=number
{ if a%2==0
{ system .out .print ( prime number)
} Else
system .out .print (not a prime number)
}
}
Similar questions