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


Please Help Members By Posting Answers For Below Questions

What is difference between && and & in c?

604


How can I read in an object file and jump to locations in it?

583


I need a sort of an approximate strcmp routine?

665


how to find anagram without using string functions using only loops in c programming

2720


how to create duplicate link list using C???

2081






What is the right way to use errno?

627


What is null pointer constant?

599


Q.1 write a program to create binary tree 1 to 16 numbers? Q.2 write a program to creat a binary search tree for the member that is given by user?

2061


What was noalias and what ever happened to it?

596


What is typedf?

674


Whats s or c mean?

597


Why doesnt the call scanf work?

679


Can you define which header file to include at compile time?

593


Why doesnt long int work?

617


find out largest elemant of diagonalmatrix

1653