DISCUSSIONS

There are no Stupid Questions ... Only Stupid people :P :P

my coding in C ...........!!!

1 comment:

  1. // prime number program

    #include
    main()
    {
    int num;
    printf("Enter your number\n");
    scanf("%d",&n);
    int i=0;
    int temp = 1;
    for(i=2;i<num;i++) // check num is prime or not
    {
    if(num%i==0)
    {
    temp =0;
    break;
    }

    }

    if(temp==1)
    {
    printf("%d is prime number ",num);
    }
    else
    {
    printf("%d is not prime number ",num);
    }

    }

    ReplyDelete