Write a program to take 10 numbers from the user and count all even , odd, +ve,and -ve numbers in C++ language | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

Write a program to take 10 numbers from the user and count all even , odd, +ve,and -ve numbers in C++ language

please do it

29th Nov 2017, 11:10 AM
Naman Jain
Naman Jain - avatar
5 Answers
+ 7
what is +ve and -ve numbers?
29th Nov 2017, 12:04 PM
Vukan
Vukan - avatar
+ 7
int even = 0, odd = 0, positive = 0, negative = 0; int array[10]; for(int i = 0; i < 10;i++) { cin >> array[i]; if(array[i] % 2 == 0) ++even; else ++odd; if(array[i] > 0) ++positive; else ++negative; } cout << even << odd << positive << negative;
29th Nov 2017, 5:41 PM
Vukan
Vukan - avatar
+ 2
Anyone....
29th Nov 2017, 12:52 PM
Hassam Ali
Hassam Ali - avatar
+ 2
please help me to make this program
29th Nov 2017, 5:37 PM
Naman Jain
Naman Jain - avatar
+ 1
what for positive and negative number
29th Nov 2017, 5:42 PM
Naman Jain
Naman Jain - avatar