C Program to Check if a given Integer is Odd or Even:
C Program to Check if a given Integer is Positive or Negative:
This is a C program to check whether a given integer is positive or negative.
Problem Description
The program takes the given integer and checks whether the integer is positive or negative.
Problem Solution
Take the integer which you want to check as input.
Check if it is greater or lesser than zero and print the output accordingly.
Exit.
Program/Source Code
Show More#include
void main()
{
int number;
printf("Enter a number \n");
scanf("%d", &number);
if (number >= 0)
printf("%d is a positive number \n", number);
else
printf("%d is a ne....
All Chapters — C programming
Similar Questions
From C Programs on integers · C programming
C Program to Compute the Sum of Digits in a given Integer:
C Program to Accept two Integers and Check if they are Equal:
.C Program to Find the Number of Integers Divisible by 5 in a given range:
C Program to Calculate the Sum of Odd & Even Numbers:
C Program to Read Two Integers M and N & Swap their Values: