#include<stdio.h>
int main() {
int num;
do {
scanf ("Enter a number (0 to exit): %d", num);
if (num>0)
printf ("The number is positive.\n");
else if (num<0)
printf ("The number is negative.\n");
else
printf ("The number is zero, neither positive nor negative\n");
} while (num);
return 0;
}
Yes, do that, because it is your homework.
An integer is a whole number that can be positive, negative, or zero. In this case, the integer representation of 25 is simply 25. It is a positive whole number that is greater than zero and does not have any fractional or decimal parts.
write a program that reads in the size of the side of square and then pints a hollow square of that size out of asterisks and blanks?
write a c++ program to convert binary number to decimal number by using while statement
write a program that reads a phrase and prints the number of lowercase latters in it using a function for counting? in C program
write a c++program by using if statement to read a number and check whether it is positive or negative
#include<stdio.h> #include<conio.h> void main() { int no; clrscr(); printf("Enter a Number:"); scanf("%d",&no); if(no>0) printf("Your Number is Positive"); else printf("Your number is Negative"); getch(); }
if it is not like that then the answer wont be write. Well, It is to be known that two negatives make a positive.
In math when you are given a negative and a positive number, you should write down the sign of the greatest number and subtract the smaller number from the greatest number. In the problem 3 - 9, three is the positive number, and nine is the negative number. This means you should write down the negative number's sign and subtract 3 from 9, and your answer should be -6.
* If "a" is positive, "-a" is negative.* If "a" is negative, "-a" is positive. * If "a" is zero, "-a" is zero. If you want to force a negative number, you can write -|a|, i.e., the negative of the absolute value.
if p represents your positive number, and n represents all of your negative numbers, then: |∑n| < p
if p represents your positive number, and n represents all of your negative numbers, then: |∑n| < p
Positive numbers are any numbers greater than zero.For example: 1, 2.9, 3.14159, 40000, and 0.0005.Negative numbers are any number less than zero.For Example: -1, -2.9, -3.14159, -40000, and -0.0005.For each positive number, there is a negative number that is its opposite. We write the opposite of a positive number with a negative or minus sign in front of the number, and call these numbers negative numbers.We do not consider zero to be a positive or negative number.The sum of any number and its (negative) opposite is 0.The sign of a number refers to whether the number is positive or negative.For example: The sign of -3.2 is negative, and the sign of 442 is positive.We may also write positive and negative numbers as fractions or mixed numbers.
In Java:if (myNumber > 0) System.out.println("The number is positive);else if (myNumber < 0) System.out.println("The number is negative);else System.out.println("The number is equal to zero);In Java:if (myNumber > 0) System.out.println("The number is positive);else if (myNumber < 0) System.out.println("The number is negative);else System.out.println("The number is equal to zero);In Java:if (myNumber > 0) System.out.println("The number is positive);else if (myNumber < 0) System.out.println("The number is negative);else System.out.println("The number is equal to zero);In Java:if (myNumber > 0) System.out.println("The number is positive);else if (myNumber < 0) System.out.println("The number is negative);else System.out.println("The number is equal to zero);
I'll write it as pseudocode; you can easily convert it to a flowchart. If your number is more than 0 (Your number is positive) else if your number is less than 0 (your number is negative) else (your number is equal to zero)
neutral
For each positive number, there is a negative number that is its opposite. We write the opposite of a positive number with a negative or minus sign in front.The opposite of a number is also called its additive inverse.For example, 5 is the additive inverse of -5 and -5 is the additive inverse of 5.