C program for whether a number is prime or not ? on January 28, 2022 Get link Facebook X Pinterest Email Other Apps Program for whether a number is prime or not ?CODE#include<stdio.h>int main(){ int i,n,p=0; printf("Enter any number"); scanf("%d",&n); for(i=2;i<n;i++) { if(n%i==0) { p++; break; } } if(p==0) printf("Prime"); else printf("Not Prime"); return 0;}OUTPUT Comments
Comments
Post a Comment