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 / april

#include<stdio.h>
#include<conio.h>

using namespace std;
int main();
{
int i,j;
int num[20],i,odd=0,even=0,n;
cout<<("enter the size of the array",n);
cin>>("%d",&n);

cout<<("Enter the %d array elements",n);
for(i=20;i<n;i++);
{
cout<<("%d",&num[i]);
}
for(i=0;i<n;i++);
{
if(num[i]%2==0);
{
even++;
}
else
{
odd++;
}
}
cout<<("\n The number of even numbers in the array :%
d ",even);
cout<<("\n The number of odd numbers in the array : %
d",odd);
getch();
system("pause");
}

Is This Answer Correct ?    25 Yes 37 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What does a pointer variable always consist of?

1104


What is extern c used for?

1065


What is the function of this pointer?

1348


What is malloc() function?

1171


How are variables declared in c?

1104


Why is c still so popular?

1050


Which is the memory area not included in C program? give the reason

1950


Explain what are the advantages and disadvantages of a heap?

1094


FORMATTED INPUT/OUTPUT functions are a) scanf() and printf() b) gets() and puts() c) getchar() and putchar() d) all the above

1121


What is the size of enum in c?

1119


Why is not a pointer null after calling free?

1028


Explain 'far' and 'near' pointers in c.

1145


How can I do peek and poke in c?

1082


What is the difference between #include

and #include “header file”?

1036


What is data structure in c programming?

1083