Like us on Facebook to get the latest links daily

Tuesday, December 20, 2011

C program to check a integer is odd or even

/* Write a C program to check whether a given integer *
 * number is positive or negative*/

#include <stdio.h>
#include <conio.h>

void main()
int number;

    printf("Enter a number\n");
scanf ("%d", &number);

if (number > 0)
printf ("%d, is a positive number\n", number);
printf ("%d, is a negative number\n", number);

Enter a number
-5, is a negative number

Enter a number
89, is a positive number

Get E-mail Subscription for Latest Updates

Don't forget to Click on activation link , sent to your E-mail ID

No comments:

Post a Comment

You might also like:

Related Posts Plugin for WordPress, Blogger...