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

Is fortran still used today?

1089


What is the use of define in c?

1055


How can you draw circles in C?

1156


Explain the use of fflush() function?

1075


Is using exit() the same as using return?

1339


Explain what does a function declared as pascal do differently?

1276


1234554321 1234 4321 123 321 12 21 1 1 12 21 123 321 1234 4321 1234554321

3710


Define recursion in c.

1276


Why is void main used?

1094


What does the message "automatic aggregate intialization is an ansi feature" mean?

1184


What is the difference between pure virtual function and virtual function?

1114


Mention four important string handling functions in c languages .

1098


What is the use of structure padding in c?

1055


What is use of #include in c?

1160


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

1051