Subscribe

RSS Feed (xml)

Tuesday, July 14, 2009

Write a C program to check whether the given number is positive, negative or zero

#include(stdio.h) // place '><' in place of '(' & ')'
#include(conio.h)
int main( )
{
int no;
clrscr( );
printf("Enter the required number to check:");
scanf("%d", &no);
if(no>0)
printf("\n %d is positive number",no);
else if(no<0)
printf("\n%d is negative number",no);
else
printf("\nEntered Number is ZERO");
getch( );
return 0;
}

Note:- If u have any doubts regarding this program or my website programs, just contact through my email-id.

4 comments:

  1. This comment has been removed by the author.

    ReplyDelete
  2. can u pleeezz give d program on c program................ to find sum of n integer using while and do while

    ReplyDelete
  3. #include
    void main()
    {
    int n;
    int a[i];
    printf("enter the limit");
    scanf("%d",&n);

    ReplyDelete
  4. plzzz tell me d program to find the sum of n-digit no.

    ReplyDelete