write a program to find the number of even integers and odd
integers in a given array in c language
Answer Posted / nikhil patil
#include<stdio.h>
#include<conio.h>main()
{
int a[5],even=0,odd=1,i;
for(i=0;i<5;i++)
scanf("%d",&a[i]);
/* display the number of odd and even intergers */
for(i=0;i<5;i++)
{
if((a[i]%2 ==0))
even++;
if((a[i]%2==1))
odd++;
}
printf("%d",even,);
printf ("%d",odd,);
getch();
| Is This Answer Correct ? | 32 Yes | 44 No |
Post New Answer View All Answers
What is the difference between ++a and a++?
What is header file definition?
Why n++ execute faster than n+1 ?
explain what are pointers?
Is python a c language?
What standard functions are available to manipulate strings?
Why array is used in c?
i have a written test for microland please give me test pattern
Why is extern used in c?
To print the pattern 1 2 3 4 5 10 17 18 19 6 15 24 25 20 7 14 23 22 21 8 13 12 11 10 9
Is it valid to address one element beyond the end of an array?
What is a constant?
What type of function is main ()?
What is non linear data structure in c?
Do pointers take up memory?