Prime no program in c | Find prime no in c In Hindi

Prime no program in c | Find prime no in c In Hindi

Prime no program in c :- Prime No In c Program ko ham is post me example ke sath samanjh te hai or fir program ko banane ke uske output ko dekhte hai |

What is Prime No : – Prime No wo hota hai jo ( N%2== 1 ) aane pr bach ta hai |

Isse Or Accha Samanjh Ne Ke Liye Ham Iske Example Ko Dekh Te Hai |

prime no program in c

Generate Prime Numbers in C With Example

Syntax Prime No :-

if (n%2==0)
{ 
   Not Prime
}
else 
 {
   Prime No
 }

Example :-

#include <stdio.h>
#include <conio.h>
int main()
{
	int n;
        printf("Enter The Number To Find Prime Or Not :");
        scanf("%d",&n);
    
        if(n%2==0)
        {
            printf("Number Is Not Prime %d",n);
        }
        else
        {
           printf("Number is Prime %d",n);
        }
    
getch();
}

Output :-

Enter The Number To Find Prime Or Not : 10
Number Is Not Prime 10


Enter The Number To Find Prime Or Not : 11
Number is Prime 11

Upper Diye Gye Output ko dekh kar aap Prime Program ko samanjh sakte hai |

Using For Loop Find Prime No with example

Example :-

#include<stdio.h>
#include<conio.h>
int main()
{
	 int n,i,flag=1;
         printf("Enter The Number To Find Prime No Or Not :");
         scanf("%d",&n);
        
         for(i=1;i<n/2;i++)
           {
               if((n%i)==0)
                     {
                        flag=0;
                        break;
                      }
                else
                       {
                         continue;
                       }
           }

          if(flag==1)
                      {
                           printf("Number is Prime");
                       }
          else
                     {
                           printf("Number is Not Prime");
                     }
getch();
}

Output :-

Enter The Number To Find Prime No Or Not : 10
Number is Not Prime


Enter The Number To Find Prime No Or Not : 11
Number is Prime

Prime program in hindi

Dosto mujhe ummed hai ki aap Program To Find Prime no Or Not In C In Hindi ko acchi tarah se samanj gye honge agar aap ko ye post acchi lage to mere is website ko jarur follow kre or ha agar aap video bhi dekhna chahte hai to aap mere channel ko bhi subscribe kar sakte hai. channel ka link aapko home page par mil jayega |

Danish Ali

I Am a 1st Sem BCA Student & I have Skills C, C++ ,Python, HTML,CSS, Computer & Advance Hacking & Blogger & YouTuber.

Leave a Reply

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