Wednesday, February 10, 2016

Check: Given number is positive or not using if..else statement.

#include<stdio.h>
void main()
{
int number;

printf("Enter number:");
scanf("%d",&number);

if(number > 0)
printf("Number is positive.");
else
printf("Number is not positive.");
}
/*Output
Enter number:11
Number is positive.
*/

No comments:

Post a Comment