write a program to find the number of even integers and odd
integers in a given array in c language
Answer Posted / rahul khare
#include<stdio.h>
#include<conio.h>
void main()
{
int a[10],even=0,odd=0,i;
for(i=0;i<9;i++)
{
if(a[i]%2==0)
{
printf("%d\t",a[i]);
even++;
}
else
{
printf("%d\t",a[i]);
odd++;
}
}
printf("Total no of Even found is=%d",even);
printf("Total no of Odd found is=%d",odd);
getch();
}
| Is This Answer Correct ? | 134 Yes | 75 No |
Post New Answer View All Answers
What is the advantage of an array over individual variables?
How do you view the path?
how many errors in c explain deply
Where define directive used?
Hi can anyone tell what is a start up code?
Can you please explain the difference between strcpy() and memcpy() function?
what do you mean by enumeration constant?
List some basic data types in c?
Explain what is the concatenation operator?
What are the disadvantages of external storage class?
What is getche() function?
What is the main difference between calloc () and malloc ()?
in multiple branching construct "default" case is a) optional b) compulsarily c) it is not include in this construct d) none of the above
What does *p++ do? What does it point to?
What is a structural principle?