Thursday, May 2, 2013

Check Positive or Negative number in C

Write a program which can Check Positive or Negative number in C.  (If enter 0 it will be break)




 #include<stdio.h>
#include<conio.h>
main()
{
    int input;
    read:
    scanf("%d",&input);
    if(input==0)
    goto stop;
    if(input>0)
    {
        printf("Positive");
        goto read;
    }
    else
    printf("Negative");
    goto read;
    stop:
    return 0;
}