Ask Question

Name:
Title:
Your Question:

Answer Question

Name:
Your Answer:
User Submitted Source Code!


Description:
  m
Language: C/C++
Code:
#include <stdio.h>
#include <conio.h>
#include <iostream.h>
int even(arr[]);
int odd(arr[]);
void main()
{int num[51],i,m,n;
cout<<"enter 51 integers";
for(i=0;i<51;i++)
cin>>num[i];
n=even(num);
m=odd(num);
cout<<"the array contains "<<n<< "even numbers";
cout<<"the array contains "<<m<< "odd numbers";
getch();}
int even(int arr[])
{int j,e=0;
for(j=o;j<51;j++)
 if(arr[j]%2==0)
e++;return e;}
int odd(int arr[])
{int k,l=0;
for(k=0;k<51;k++)
 if(arr[]%2==1)
l++; return e;}
          
Comments: