To know the number of even/odd numbers, we use the modulus function. ‘%’
The program is:
#include<stdio.h> #include<conio.h> #define MAX 99 main() { int a[MAX],i,n,even,odd; printf("Enter the number of elements in the array\n"); scanf("%d",&n); printf("Enter the elements"); for(i=0;i<n;i++) scanf("%d",&a[i]); even=0; odd=0; for(i=0;i<n;i++) { if(a[i]%2==0) even++; else if(a[i]%2!=0) odd++; } printf("The number of even elements are:%d\nThe number of odd elements are:%d",even,odd); getch(); }
great site
excellent blog
i like your programs, thanks
Hi there it’s me, I am also visiting this site regularly,
this website is actually nice and the visitors are really sharing pleasant thoughts.
Thanks for the marvelous posting! I actually enjoyed reading
it, you may be a great author.I will remember to bookmark your blog and will come back from now on. I want
to encourage you to definitely continue your great writing, have
a nice afternoon!
I blog often and I seriously thank you for your content. The article
has really peaked my interest. I am going to take a note of your website
and keep checking for new information about once per week.
I opted in for your Feed as well.