6. Check whether number is positive or negative.


Comments

  1. /* Program to count positive,negative and zero from given input*/

    #include

    void main()
    {
    int cnt1=0,cnt2=0,cnt3=0;
    int i,no;
    printf("Enter the 5 Numbers......");
    for(i=1;i<=5;i++)
    {
    scanf("%d",&no);

    if(no>0)
    {
    cnt1++;
    }

    if(no<0)
    {
    cnt2++;
    }
    if(no==0)
    {
    cnt3++;
    }

    }

    printf("\nThe POSITIVE numbers=%d",cnt1);
    printf("\nThe NEGATIVE numbers=%d",cnt2);
    printf("\nThe ZERO's numbers=%d\n",cnt3);
    }

    ReplyDelete
  2. #include
    void main()
    {
    int num;
    printf("\nEnter num \n");
    scanf("%d",&num);
    if(num>0)
    printf("\nNum is positive\n");
    else
    printf("\nNum is negative\n");
    }

    ReplyDelete
  3. lengarepooja1:24 PM

    /*program to check Entered no is positive or negative*/
    #include
    void main()
    {
    int no;
    printf("\nEnter ano:");
    scanf("%d",&no);
    if(no>0)
    {
    printf("\n %d is positive no\n",no);

    }
    if(no<0)
    {
    printf("\n%d is a negative no\n",no);
    }
    if(no==0)
    {
    printf("%d is equalto zero\n",no);
    }
    }

    ReplyDelete
  4. /* count of positive negativ zero using for loop*/
    #include
    void main()
    {
    int no;
    int i,c1=0,c2=0,c3=0;
    for(i=1;i<=5;i++)
    {
    printf("\nEnter a no:\n");
    scanf("%d",&no);
    if(no>0)
    {
    c1++;
    }
    if(no<0)
    {
    c2++;
    }
    if(no==0)
    {
    c3++;
    }

    }
    printf("\nCount of positive no:%d",c1);
    printf("\nCount of negative no:%d",c2);
    printf("\nCount of zero:%d\n",c3);

    }

    ReplyDelete
  5. abcd asdh11:14 AM

    sample comment

    ReplyDelete
  6. Akshay Sidwadkar11:53 AM

    /* Program to count positive,negative and zero from given input*/

    #include

    void main()
    {
    int cnt1=0,cnt2=0,cnt3=0;
    int i,no;
    printf("Enter the 5 Numbers......");
    for(i=1;i<=5;i++)
    {
    scanf("%d",&no);

    if(no>0)
    {
    cnt1++;
    }

    if(no<0)
    {
    cnt2++;
    }
    if(no==0)
    {
    cnt3++;
    }

    }

    printf("\nThe POSITIVE numbers=%d",cnt1);
    printf("\nThe NEGATIVE numbers=%d",cnt2);
    printf("\nThe ZERO's numbers=%d\n",cnt3);
    }

    ReplyDelete
  7. Sayali Daunde11:57 AM

    #include
    void main()
    {
    int num;
    printf("\nEnter num \n");
    scanf("%d",&num);
    if(num>0)
    printf("\nNum is positive\n");
    else
    printf("\nNum is negative\n");
    }

    ReplyDelete
  8. Sachita Jadhav11:59 AM

    #include
    void main()
    {
    int a;
    printf("\n\t enter no.");
    scanf("%d",&a);
    if(a>0)
    printf("\n\t positive");
    else
    printf("\n\t negative");
    }

    ReplyDelete
  9. Mubin Pirjade12:00 PM

    It's a correct program!Check it out!!
    //+ve or -ve
    #include
    void main()
    {
    int num;
    printf("\n\tEnter a number:");
    scanf("%d",&num);
    if(num>0)
    printf("\n\tPositive number");
    else
    printf("\n\tNegative number");
    }

    ReplyDelete
  10. sonali nagane12:09 PM

    #include
    void main()
    {
    int a;
    printf("\n Enter the number");
    scanf("%d",&a);
    if(a>0)
    {
    printf("\n number is positive");
    }
    else
    {
    printf("\n number is negative");
    }
    }

    ReplyDelete
  11. Radha Ghadge SE 2312:13 PM

    #include
    void main()
    {
    int num;
    printf("\n enter the number=");
    scanf("%d",&num);
    if(num>0)
    {
    printf("\n positive");
    }
    else
    {
    printf("\n negative");
    }
    }

    ReplyDelete
  12. Swati Waghmare12:17 PM

    /*To check No.is positive ,Negative by using multiple if statement,13-july-2016*/
    #include
    void main()
    {
    int num;
    printf("Enter a num");
    scanf("%d",&num);
    if(num>0)
    {
    printf("\n\tnum is Positive");
    }
    if(num<0)
    {
    printf("\n\tnum is Negative");
    }
    }

    ReplyDelete
  13. Krushna Sontakke12:20 PM

    // checking either no +ve ,-ve or zero
    #include
    void main()
    {
    int num,cnt1=0,cnt2=0,cnt3=0;
    int i=1;
    for(i=1;i<=5;i++)
    {
    printf("\n Enter a number= ");
    scanf("%d",&num);
    if(num>0)
    cnt1++;
    if(num<0)
    cnt2++;
    if(num==0)
    cnt3++;
    }
    printf("\n Positive=%d \n Negative=%d \n Zero=%d \n",cnt1,cnt2,cnt3);
    }

    ReplyDelete
  14. Bhosale Dhanashri SE38:41 AM

    /* Program to count positive,negative and zero from given input*/

    #include

    void main()
    {
    int cnt1=0,cnt2=0,cnt3=0;
    int i,no;
    printf("Enter the 5 Numbers......");
    for(i=1;i<=5;i++)
    {
    scanf("%d",&no);

    if(no>0)
    {
    cnt1++;
    }

    if(no<0)
    {
    cnt2++;
    }
    if(no==0)
    {
    cnt3++;
    }

    }

    printf("\nThe POSITIVE numbers=%d",cnt1);
    printf("\nThe NEGATIVE numbers=%d",cnt2);
    printf("\nThe ZERO's numbers=%d\n",cnt3);
    }

    ReplyDelete
  15. poonam pusavale9:15 AM

    #include
    void main()
    {
    int num;
    printf("\n\t enter a number");
    scanf("%d",&num);
    if(num>=0)
    {
    printf("\n\t number is positive");

    }
    if(num<=0)
    {
    printf("\n\t number is negative");
    }
    if(num==0)
    {
    printf("\n\t number is zero");
    }
    }

    ReplyDelete
  16. sushmita swami9:29 AM

    #include
    void main()
    {
    int num;
    printf("\n\t enter the num");
    scanf("%d",&a);
    if (num>0)
    printf("\n\t num is positive");
    else
    printf("\n\t num is nigative");
    }

    ReplyDelete
  17. #include

    void main()

    {

    int num;

    printf("\n\t Enter number=");
    scanf("%d",&num);

    if(num>0)

    {


    printf("\n\t Entered number is positive");

    }

    else

    {

    printf("\n\t Entered number is negative");

    }

    }

    ReplyDelete
  18. This comment has been removed by the author.

    ReplyDelete
  19. //program to check whether the number positive, negative, zero
    #include
    void main()
    {
    int i=1, cntt1=0, n, cnt2=0, cnt3=0;
    for(i=1; i<=5; i++)
    {
    printf("\n Enter a number=\t");
    scanf("%d",&n);
    if(n>0)
    {
    cnt1++;
    printf("\n Nos are +ve");
    }
    if(n<0)
    {
    cntt2++;
    printf("\nnos are -ve");
    }
    if(num==0)
    {
    cntt3++;
    rintf("\n No is zero");
    }
    }
    printf("\n+ve no=%d, -ve no=%d, zero=%d", cntt1, cnt2, cnt3);
    }

    ReplyDelete
  20. #include

    void main()

    {

    int num;

    printf("\n\t Enter number=");
    scanf("%d",&num);

    if(num>0)

    {


    printf("\n\t Entered number is positive");

    }

    else

    {

    printf("\n\t Entered number is negative");

    }

    }

    ReplyDelete
  21. Ranjit Kalubarme12:31 PM

    #include
    void main()
    {
    int a;
    printf("\n\t enter no.");
    scanf("%d",&a);
    if(a>0)
    printf("\n\t POSITIVE");
    else
    printf("\n\t NEGATIVE");
    }

    ReplyDelete
  22. sanjivani atakare4:04 PM

    #include
    void main()
    {
    int num;
    printf("\n\tenter a number");
    scanf("%d",&num);
    if(num>0)
    {
    printf("\n\t positive no");
    }
    if(num<0)
    {
    printf("\n\t negative no");
    }
    if(num==0)
    {
    printf("\n\t zero no");
    }
    }

    ReplyDelete
  23. puja khandare11:18 AM

    #include
    void main()
    {
    int num,c1,c2,c3;
    int i;
    for(i=0;i<=5;i++);
    {
    printf("\n\t enter the number");
    scanf("%d",&num);
    }
    if(num>0)
    {
    c1++;
    }
    if(num<0)
    {
    c2++;
    }
    if(num==0)
    {
    c3++;
    }
    printf("\n\t count of positive number=%d",c1);
    printf("\n\t count of negative number=%d",c2);
    printf("\n\t count of zero=%d",c3);
    }

    ReplyDelete
  24. /*program to check Entered no is positive or negative*/
    #include
    void main()
    {
    int a;
    printf("enter two number==");
    scanf("%d",&a);
    if(a>0)
    {
    printf("number is positive\n");
    }
    else
    {
    printf("number is negative\n");
    }
    }

    ReplyDelete
  25. Awate Snehal10:18 AM

    /*Number is positive or negative*/
    #include
    void main()
    {
    int num;
    printf("\n enter num");
    scanf("%d",&num);
    if(num>0)
    {
    printf("\n number is positive");
    }
    else
    {
    printf("\n number is negative");
    }
    }

    ReplyDelete
  26. rajashree bhosale SE443:50 PM

    #include
    void main()
    {
    int r;
    printf("\nEnter a No");
    scanf("%d",&r);
    if(r>0)
    {
    printf("\n No is positive");
    }
    else
    {
    printf("\n No is negative");
    }
    }

    ReplyDelete
  27. Survase Sayali 334:22 PM

    #include
    void main()
    {
    int num;
    printf("Enter the number");
    scanf("%d",&num);
    if(num==0)
    {
    printf("Number is zero");
    }
    else

    if(num<0)
    {
    printf("Number is negative");
    }

    else

    if(num>0)
    {
    printf("Number is positive");
    }
    }

    ReplyDelete
  28. madhuri pujari4:30 PM

    /* Check entered no is Positive or Negative*/
    #include
    void main()
    {
    int a;
    printf("\nEnter a no:\n");
    scanf("%d",&a);
    if(a>0)
    {
    printf("\nPositive No");
    }
    else
    {
    printf("\nNegative No");
    }
    }

    ReplyDelete

Post a Comment