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

Write a program to swap two numbers without using the third variable?

1115


What are the types of i/o functions?

1416


What does *p++ do? What does it point to?

1119


what is the significance of static storage class specifier?

2338


Why do we use null pointer?

1111


What is the collection of communication lines and routers called?

1180


What is the difference between new and malloc functions?

1177


What is function definition in c?

1116


What is malloc() function?

1227


Is that possible to add pointers to each other?

1420


How can I read data from data files with particular formats?

1090


What are the storage classes in C?

1200


What is array within structure?

1168


What is the use of clrscr?

1156


Calculate 1*2*3*____*n using recursive function??

2095