Computer Science, asked by masoomamalik, 1 year ago

please give me a c program in which we check wheather a number is prime or nor by using switch...

Answers

Answered by mujaffarbhati4p1xyhw
1
#include
int main()
{
int en_number,flag,I
//en_number= entered number
//Flag= count the number of times
printf("enter the no which has to be checked");
scanf("%d",en_number);
for(i=2;I<=en_number;i++);
{
If(en_number/i==0)
{
flag=1;
}}
switch(flag);
{
case 0: printf("prime");
case 1 : printf("composite");
default : printf(" re enter");
break;
}}

Similar questions