write a program to find the number of even integers and odd
integers in a given array in c language
Answer Posted / lakshmi
#include<studio.h>
#include<conio.h>
main()
{
int a[5],count_even=0,count_odd=0,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))
count_even++;
if((a[i]%2==1))
count_odd++;
}
printf("%d %d",count_even,count_odd);
getch();
}
| Is This Answer Correct ? | 217 Yes | 96 No |
Post New Answer View All Answers
What is a macro in c preprocessor?
Explain the use of 'auto' keyword in c programming?
What is fflush() function?
Why c is a mother language?
Write a program to print factorial of given number without using recursion?
Explain the concept and use of type void.
what do the 'c' and 'v' in argc and argv stand for?
What is the purpose of void in c?
What are register variables? What are the advantage of using register variables?
Define VARIABLE?
Write a program to print "hello world" without using a semicolon?
write a program fibonacci series and palindrome program in c
Is it possible to have a function as a parameter in another function?
How can I access an I o board directly?
number of times a digit is present in a number