write a program to find the number of even integers and odd
integers in a given array in c language
Answer Posted / merlin
#include<studio.h>
#include<conio.h>
void main()
{
int a[20],even=0,odd=0,i,n;
printf("Enter the size of the array");
scanf("%d",&n);
printf("Enter the elements");
for(i=0;i<n;i++)
{
scanf("%d",&a[i]);
}
for(i=0;i<n;i++)
{
if((a[i]%2 ==0))
even++;
else
odd++;
}
printf("%d %d",even,odd);
getch();
}
Is This Answer Correct ? | 15 Yes | 19 No |
Post New Answer View All Answers
What are the preprocessor categories?
How #define works?
What is a scope resolution operator in c?
What is a shell structure examples?
What was noalias and what ever happened to it?
Which are low level languages?
What are the 4 data types?
What is sizeof int in c?
How can I find the modification date of a file?
What is the difference between āgā and āgā in C?
Explain what is wrong with this statement? Myname = ?robin?;
What type is sizeof?
What is structure and union in c?
Explain what is a const pointer?
what are enumerations in C