C Program For Prime Number

Get Certified in C Programming and Take Your Skills to the Next Level

Program 1

// Progrtam for prime number
#include<stdio.h>
#include<conio.h>
int main()
{
     int n,i=2,f=0;
     printf("Enter a number");
     scanf("%d",&n);
    while(i<n-1)
     {
           if(n%i==0)
           {
            f=1;
            break;
           }
          i++; 
     }
     if(f==0)
     printf("\nNo is prime");
     else
     printf("\nNo is not prime");
}

 

You give me 15 seconds I promise you best tutorials
Please share your happy experience on Google

courses

TechVidvan Team

TechVidvan Team provides high-quality content & courses on AI, ML, Data Science, Data Engineering, Data Analytics, programming, Python, DSA, Android, Flutter, full stack web dev, MERN, and many latest technology.

Leave a Reply

Your email address will not be published. Required fields are marked *