Your AD CODE HERE

Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Write a C program to check whether a given integer number is positive or negative
12-10-2011, 01:16 AM
Post: #1
Your Google Ad Here
Write a C program to check whether a given integer number is positive or negative
Code C :
 
#include
#include
 
void main()
{
int number;
clrscr();
 
{FNAMEL}.html">printf("Enter a number\n");
scanf ("%d", &number);
 
if (number > 0)
{FNAMEL}.html">printf ("%d, is a positive number\n", number);
else
{FNAMEL}.html">printf ("%d, is a negative number\n", number);
 
}
/*-----------------------------
Output
Enter a number
-5
-5, is a negative number
 
RUN2
Enter a number
89
89, is a positive number
------------------------------*/

 

Find all posts by this user
Quote this message in a reply
   

Post Reply 


Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Check if a given string is the substring of another string or not expert.here 1 510 06-24-2012 07:39 PM
Last Post: Sahib
  C program to find and output all the roots of a quadratic equation, for non-zero coef expert.here 1 1,556 05-02-2012 09:25 PM
Last Post: swethauday
  Simple C program to create a linked list and display list elements expert.here 0 1,518 12-12-2011 02:09 AM
Last Post: expert.here
  C program to store employee records in a file expert.here 0 1,003 12-12-2011 02:07 AM
Last Post: expert.here
  C program to find the sum of 2 dimensional array using dynamic mem allocation expert.here 0 688 12-12-2011 02:04 AM
Last Post: expert.here
  C program to find if a matrix is sparse or not expert.here 0 778 12-12-2011 02:01 AM
Last Post: expert.here
  C program t find the trace and normal of a matrix expert.here 0 983 12-12-2011 02:00 AM
Last Post: expert.here
  C program to calculate the sum of rows and columns of Matrixsum of expert.here 0 2,356 12-12-2011 01:58 AM
Last Post: expert.here
  C program to find the sum of all digits present in a String expert.here 0 1,368 12-12-2011 01:55 AM
Last Post: expert.here
  C program to find the quadrant from x-y coordinates expert.here 0 1,507 12-12-2011 01:53 AM
Last Post: expert.here

Forum Jump:


User(s) browsing this thread: 1 Guest(s)