Tuesday 4 December 2012

c program for positive (+ve)and negative(-ve) number | comments with source code example


Positive number means number which is not negetive means number greater than 0 or equal to zero.
let's take example.
9 - 8=1
After subtracting 8 from 9 we will get out put =1 that is positive.
but if i will subtract 9 from 8 like 8 - 9= -1.
i will get out put like -1.
go to start -> run  -> calc .
it will open calci and then  you can calculate.or do any kind of calculation.so , in this program i am going to show  How to find out positive and negative number.
with comments in c program with source code.at last output.

#include<stdio.h>    //header files//
#include<conio.h>   //for clrscr//
main()
{                           //main start//
int user_number;       //declaration//
clrscr();                    //clear the screen//
printf("enter any number"); //taken number from user//
scanf("%d",&number);
//condition//

if(user_number>0)  //if user number is Greater than zero//
{
printf("\n the given number  is positive");
}

if(user_number<0) //if user number is Less than zero//
{
printf("\n the given number  is negetive");
}
getch();
}               //Let see the out-put
output is
enter any number 68
number  is positive

enter any number -56
a is negative
Share This
Previous Post
Next Post

FYJC XI standard online admisson Process and declaraton of Merit list . Cut off List For prevous year also . 10 Th Results onlne declaraton Maharashtra Region .

0 comments: