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

#include<stdio.h>
#include<conio.h>main()
{
int a[5],even=0,odd=1,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))
even++;
if((a[i]%2==1))
odd++;
}
printf("%d",even,);
printf ("%d",odd,);
getch();

Is This Answer Correct ?    32 Yes 44 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

A collection of data with a given structure for excepting storing and providing on demand data for multiple users a) linked list b) datastructer c) database d) preprocessor

1038


write a program to print largest number of each row of a 2D array

2268


Why is c called a mid-level programming language?

1153


What are 3 types of structures?

1027


What is the difference between text and binary i/o?

997


How can I automatically locate a programs configuration files in the same directory as the executable?

1103


How do you initialize pointer variables?

1031


What is array of structure in c?

1098


What kind of structure is a house?

994


Which is better oop or procedural?

988


Why is a semicolon (;) put at the end of every program statement?

1030


How many levels of indirection in pointers can you have in a single declaration?

1026


printf(), scanf() these are a) library functions b) userdefined functions c) system functions d) they are not functions

1096


Explain what’s a signal? Explain what do I use signals for?

1053


What happens if a header file is included twice?

985