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 / 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


Please Help Members By Posting Answers For Below Questions

What is || operator and how does it function in a program?

1040


Explain how do you print only part of a string?

1157


1234554321 1234 4321 123 321 12 21 1 1 12 21 123 321 1234 4321 1234554321

3632


What are the properties of union in c?

994


Write a program to print factorial of given number using recursion?

959


Explain why c is faster than c++?

1000


How is actual parameter different from the formal parameter?

973


What is the maximum length of an identifier?

1129


What is the use of a ‘’ character?

1026


What is binary tree in c?

1036


What does a pointer variable always consist of?

1038


a function gets called when the function name is followed by a a) semicolon (;) b) period(.) c) ! d) none of the above

1325


What is c token?

1009


Why can’t we compare structures?

1225


All technical questions

1921