Hello friends!!!!!
Pgr to print whether the number is prime or not
C LANGUAGE
Rishendra
9/11/20241 min read
#include <stdio.h>
int main() {
int a,i,count = 0;
printf("Enter a number : ");
scanf("%d", &a);
for(i=2 ; i<a ; i++) {
if(a % i == 0){
count = 1;
}
}
if(count>=1) {
printf("Composite");
}
else {
printf("Prime");
}
return 0;
}
Output :
Enter a number : 23
Prime
=== Code Execution Successful ===