C Program to Check if Given Number is Positive

Write C program to Check if the Given Number is Positive

//WAP to check whether the given number is positive

#include<stdio.h>

int main()
{
	int n;

	printf("Enter the number :--> ");
	scanf("%d", &n);

	if(n > 0)
	{
		printf("The given number is positive");
	}


	return 0;

}

Output:

Run 1:
Enter the number :--> 9
The given number is positive

Run 2:
Enter the number :--> -9

(No outout as it is not positive)

≪ Previous | Next ≫