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 dynamic dispatch in c++?

1064


Write a program with dynamically allocation of variable.

1134


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

2474


program to find error in linklist.(i.e find whether any node point wrongly to previous nodes instead of next node)

2096


What is the use of clrscr?

1107


Devise a program that inputs a 3 digit number n and finds out whether the number is prime or not. Find out its factors.

1126


What happens if you free a pointer twice?

1084


What is a function in c?

1582


What is the difference between mpi and openmp?

1301


Do you know what are bitwise shift operators in c programming?

1105


Can you please explain the difference between syntax vs logical error?

1190


What is the purpose of 'register' keyword in c language?

1030


How will you find a duplicate number in a array without negating the nos ?

2135


Compare array data type to pointer data type

1033


What are examples of structures?

1114