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 / ankit kumar sharma

#include<stdio.h>
#include<conio.h>
void main()
{
int a[5],count_even=0,count_odd=0,i;

printf("Enter the value in Array\n");
for(i=0;i<5;i++)
scanf("%d",&a[i]);
/* Calculating 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++;
}
/* display the number of odd and even intergers */
printf(" Total number of even integer are %d\n ",count_even);
printf("Total number of odd integer are %d", count_odd);
getch();
}

Is This Answer Correct ?    13 Yes 16 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Give me the code of in-order recursive and non-recursive.

1320


Differentiate call by value and call by reference?

916


how to print the character with maximum occurence and print that number of occurence too in a string given ?

2412


What is the size of structure in c?

1095


Which is best book for data structures in c?

1039


Is struct oop?

960


What is the use of volatile?

1043


writ a program to compare using strcmp VIVA and viva with its output.

1976


If null and 0 are equivalent as null pointer constants, which should I use?

1120


What is static function in c?

1065


What does the characters “r” and “w” mean when writing programs that will make use of files?

1422


What is the use of parallelize in spark?

976


Why is it important to memset a variable, immediately after allocating memory to it ?

2000


How can I find out how much free space is available on disk?

1013


Explain bitwise shift operators?

1171