#include <iostream>
#include <cstdlib>
using namespace std;
int main()
{
int count =0;
int sum = 0;
int positivecount = 0;
int negativecount = 0;
double average;
cout <<"Enter any integer or enter 0 to exit ::";
cin >> count;
while(count != 0)
{
sum += count;
average = sum / static_cast<double>(count);
count++;
if(count < 0)
{
negativecount++;
}
if (count > 0)
{
positivecount++;
}
cout <<"Enter any integer or enter 0 to exit ::";
cin >> count;
}
cout <<"the average of the numbers is " << average <<"\n";
cout <<"There are " << negativecount <<" negative numbers\n";
cout <<"There are " << positivecount<<" positive numbers\n";
system("pause");
return 0;
}
by rijaalu
#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; }
Accept 5 numbers in an array and display it.
18
By subtracting any two of the numbers A-B , if the output number is negative , B IS GREAT and if its positive A is great
ALGORITHM SAMPLE i = 0 REPEAT OUTPUT ("Enter a number: ") INPUT (number[i]) i ++ UNTIL (number[i] 0) THEN counter++ sum = sum + number[i] END IF END FOR DISPLAY (counter) DISPLAY (sum / counter) END SAMPLE
Negative number and positive numbers are all numbers. Negative numbers are just positive numbers multiplied by -1.
Negative * positive = negative Positive * positive = positive Negative * negative = positive
Negative because product of 47 negative numbers is negative and product of three positive number is Positive , so negative*positive = Negative.
(The product of 33 negative numbers) x (2 positive numbers) = (negative sign) x (positive sign) = negative sign
negative
positive
'cuz
Positive x Positive =Positive Positive x Negative= Negative Negative x Positive= Negative Negative x Negative =Positive
It is positive. Any product of an even number of negative numbers will be positive, regardless of how many positive numbers you have. Similarly any product of an odd number of negative numbers will be negative, regardless of how many positive numbers you have.
yes integers are all numbers negative and positive
Positive numbers, on your door. Negative in your freezer.
Positive numbers are larger than negative ones.