• The Facebook Platform

Results 1 to 4 of 4

Thread: prime or not

  1. #1
    Join Date
    Jan 2011
    Location
    lahore
    Posts
    51
    Points
    58.63
    Rep Power
    58

    new_new prime or not

    ye programe hai jo btaye ga k number prime hai ya nahi.


    #include<stdio.h>
    #include<conio.h>
    void main(void)
    {
    int i,j=2,ch=0;
    printf("\nENTER ANY NUMBER");
    scanf("%d",&i);
    while(j<=i/2)
    {
    if(i%j==0)
    {
    printf("%d IS NOT PRIME",i);
    ch=1;
    break;
    }
    else
    {
    j++;
    }
    }
    if(ch==0)
    {
    printf("%d IS PRIME",i);
    }
    getch();
    }






  2. #2
    Join Date
    Jan 2010
    Location
    Lahore, Pakistan
    Age
    25
    Posts
    3,818
    Points
    6,772.51
    Rep Power
    10000

    Default

    nice sharing..
    Find Me On Social Networks

    Facebook | Twitter | Google+


  3. #3
    Join Date
    Jan 2011
    Location
    lahore
    Posts
    51
    Points
    58.63
    Rep Power
    58

    Default

    thankx, aur yar file attach nahi ho rahi plz guide me????

  4. #4
    Join Date
    Jun 2012
    Posts
    130
    Points
    143.53
    Rep Power
    136

    Default

    Thank you for sharing this.


 

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •