Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

What is void main ()?

1123


How can I recover the file name given an open stream?

1081


Define macros.

1328


What are the types of pointers?

1189


What is the difference between #include

and #include “header file”?

1091


What are the advantages of using Unions?

1172


Explain spaghetti programming?

1321


Which is better pointer or array?

1071


What are the complete rules for header file searching?

1132


What is meant by int main ()?

1256


Write an algorithm for implementing insertion and deletion operations in a singly linked list using arrays ?

3566


why to assign a pointer to null sometimes??how can a pointer we declare get assigned with a garbage value by default???

2028


What is the auto keyword good for?

1231


What is omp_num_threads?

1135


What is d scanf?

1140