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

What is the use of ?: Operator?

1076


How many parameters should a function have?

1124


What is header file definition?

1022


Can you please explain the difference between malloc() and calloc() function?

1047


WHICH TYPE OF JOBS WE GET BY WRITING GROUPS .WHEN THE EXAMS CONDUCTED IS THIS EXAMS ARE CONDUCTED EVERY YEAR OR NOT.PLS TELL ME THE ANSWER

1798


What is main return c?

931


write a program to print the consecutive repeated character from the given string... input string is : hhhhjkutskkkkkggggj output should be like this: hhhhkkkkkgggg anyone help me...

1878


Explain the difference between null pointer and void pointer.

1029


What is new line escape sequence?

1262


the maximum length of a character constant can be a) 1 character b) 8 characters c) 256 chaacters d) 125 characters

2228


Why does everyone say not to use gets?

1023


#include main() { enum _tag{ left=10, right, front=100, back}; printf("left is %d, right is %d, front is %d, back is %d",left,right,front,back); }

1061


What is the scope of global variable in c?

946


When I tried to go into a security sites I am denied access and a message appeared saying 'applet not initialize'. How can I rectify this problem.

1931


What is the difference between formatted&unformatted i/o functions?

1000