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 / jasna.c

#include<stdio.h>
#include<conio.h>
void main()
{
int arr[100],i,odd=0,even=0,n;
printf("enter the size of the array");
scanf("%d",&n);
printf("Enter the %d array elements",n);
for(i=0;i<n;i++)
{
scanf("%d",&arr[i]);
}
for(i=0;i<n;i++)
{
if(arr[i]%2==0)
{
even++;
}
else
{
odd++;
}
}
printf("\n The number of even numbers in the array :%d ",even);
printf("\n The number of odd numbers in the array : %d",odd);
getch();
}

Is This Answer Correct ?    26 Yes 41 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is output redirection?

1210


How can you determine the maximum value that a numeric variable can hold?

1227


How arrays can be passed to a user defined function

1017


Explain the difference between the local variable and global variable in c?

1068


Write a program in c to replace any vowel in a string with z?

1116


can anyone suggest some site name..where i can get some good data structure puzzles???

2082


what is ur strangth & weekness

2414


In a byte, what is the maximum decimal number that you can accommodate?

1134


Explain heap and queue.

1073


What does #pragma once mean?

1161


Tell us something about keyword 'auto'.

1070


What is the use of extern in c?

1092


Why main function is special give two reasons?

1537


What are called c variables?

1054


How can you restore a redirected standard stream?

1117