Good day in this article I would like to share with you guys a very simple program that I wrote using C as my programming language. I called this simple program positive and negative number checker in C. What program does is to ask the user to give a number and then our program will check and determines whether the given number is a positive or negative number. It uses conditional if statement to achieve the results. I am using CodeBlocks 16.1 in creating this program. I hope you will find my work useful. Thank you.
My email address are the following jakerpomperada@gmail.com and jakerpomperada@yahoo.com.
My mobile number here in the Philippines is 09173084360.
Sample Program Output
Program Listing
/* Positive and Negative Number Checker in C */
/* Author : Mr. Jake R. Pomperada, MAED-IT */
/* Date : March 1, 2017 Wednesday */
/* Tools : CodeBlocks 16.1 */
/* Country : Philippines */
#include <stdio.h>
int num_value = 0;
int main()
{
printf("\n\n");
printf("\t===== POSITIVE AND NEGATIVE NUMBER CHECKER IN C =====");
printf("\n\n");
printf("Give a Number : ");
scanf("%d",&num_value);
if (num_value > 0 ) {
printf("\n\n");
printf("The given number %d is a POSITIVE NUMBER.",num_value);
}
else if (num_value < 0 ) {
printf("\n\n");
printf("The given number %d is a NEGATIVE NUMBER.",num_value);
}
else {
printf("\n\n");
printf("The given number %d is a ZERO.",num_value);
}
printf("\n\n");
printf("END OF PROGRAM");
printf("\n\n");
}