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 / anup majhi

#include<stdio.h>
#include<conio.h>
#define size 100
void check(int[],int);
int i;
main(){
int a[size],m
printf("Enter the array length ");
scanf("%d",&m);
printf("Supply elements to the array ");
for(i=0;i<m;i++)
scanf("%d",&a[i]);
check(a,m);
}
void check(int a[],int b){
int even=0,odd=0;
for(i=0;i<b;i++){
if(a[i]%2==0)
even++;
else
odd++;
}
printf("Number of even no. in the array =%d ",even);
printf("\nNumber of odd no. in the array =%d ",odd);
}


out put:
Enter the array length 5
Supply array elements 1 2 3 4 5
Number of even no. in the array =2
Number of odd no. in the array =3

Is This Answer Correct ?    11 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is uint8 in c?

1055


What is the g value paradox?

1104


Write a program to generate the Fibinocci Series

1161


application areas a 'c' a) operating system b) graphics, interpreter, assembler c) program evalution, communication softwares d) all the above

1014


how to find binary of number?

4336


What is multidimensional arrays

1063


Which is best linux os?

971


why return type of main is not necessary in linux

2042


How can I recover the file name given an open stream or file descriptor?

1029


In which layer of the network datastructure format change is done

1836


How arrays can be passed to a user defined function

965


How do you print an address?

1212


Difference between MAC vs. IP Addressing

1094


how to execute a program using if else condition and the output should enter number and the number is odd only...

2207


Calculate 1*2*3*____*n using recursive function??

1981