Sat Jun 25 2022 04:34:40 GMT+0000 (Coordinated Universal Time)
Saved by @KanishqJ8
#include <stdio.h> int main() { int n; printf("enter the number : "); scanf("%d",&n); int isPrime=1; for(int i=2; i<sqrt(n); i++){ if(n%i==0){ isPrime=0; } } if(isPrime){ printf("prime"); } else{ printf("not prime"); } return 0; }
Copy this HTML code:
Preview:
open_in_newInstructions on embedding in Medium
Comments