#include <stdio.h>
#include <conio.h>
void main()
{
int number;
clrscr();
printf(“Enter a number\n”);
scanf (“%d”, &number);
if (number > 0)
printf (“%d, is a positive number\n”, number);
else
printf (“%d, is a negative number\n”, number);
}
/*—————————–
Output
Enter a number
-5
-5, is a negative number
RUN2
Enter a number
89
89, is a positive number
——————————*/
Not Satisfied ? Just search & get the result
Related posts:
- C program to check whether a given integer is odd or even
- Sample – check if a number is prime
- Sample – Program to enter an integer and print its total value based on the formula ‘x – 1/3!x3 + 1/5!x5 – 1/7!x7 + 1/9!x9′.
- Sample – Program to convert 2-digit octal number into binary number and print it.
- Sample – Program to enter an integer and output the cube of that integer.
