0
Can anyone tell me a C++ Program to print total no. of even and odd elements in an array?
I want a c++ program to print the total number of even and odd elements entered in an array For example int arr[2,3,4,5,6] Output= No. of Even numbers=3 No. of Odd numbers=2
5 Respuestas
+ 2
I can only tell write about logic :
int even, odd
for(int i=0;i<5;i++){
if( arr[i] %2==0)
even++
else
odd++
0
Yeah i know this logic but i want to print the total numbers of both even and odd numbers in the array.That's the problem for me
0
Post your code, so that we could help you with a little tweak
0
Thanks Happy to Help but can we do it without using the function?
0
Ok Thanks All.