Q.: Write C Program to Determine Whether given number is positive, negative or zero using if…else statement.
We can check multiple conditions like three conditions using nested if else in C Programming.
Source Code:
#include<stdio.h>
#include<conio.h>
void main()
{
int no;
clrscr();
printf("nnt Enter Any Number : ");
scanf("%d",&no);
if(no>0)
{
printf("nnt Given Number is Positive !");
}
else if(no<0)
{
printf("nnt Given Number is Negative !");
}
else
{
printf("nnt Number is Zero !");
}
getch();
}
Output:

Fig. : Check Number is Positive or Negative or Zero
Version : Turbo C++ Version 3.0 (Borland International, Inc.)


VERY GOOD
Thanks a lot for contacting TechnoExam.com and giving feedback! Stay connected with us for more updates…