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 the c language function prototype?

1099


How do you redirect a standard stream?

1118


What are control structures? What are the different types?

1100


Process by which one bit pattern in to another by bit wise operation is?

1177


What are the three constants used in c?

1003


Why is c used in embedded systems?

1132


What the advantages of using Unions?

1239


What is wrong with this program statement? void = 10;

1266


What are the different types of linkage exist in c?

1038


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

1985


What is function prototype in c language?

1044


Can a local variable be volatile in c?

1010


What is a newline escape sequence?

1113


Write a program to check armstrong number in c?

1139


Explain what are compound statements?

1070