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 / nikhil patil

#include<stdio.h>
#include<conio.h>main()
{
int a[5],even=0,odd=1,i;

for(i=0;i<5;i++)

scanf("%d",&a[i]);
/* display the number of odd and even intergers */
for(i=0;i<5;i++)
{
if((a[i]%2 ==0))
even++;
if((a[i]%2==1))
odd++;
}
printf("%d",even,);
printf ("%d",odd,);
getch();

Is This Answer Correct ?    32 Yes 44 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to delete a node from linked list w/o using collectons?

2743


Explain how can you restore a redirected standard stream?

1061


Write a code to achieve inter processor communication (mutual exclusion implementation pseudo code)?

1095


What is the symbol indicated the c-preprocessor?

1195


disply the following menu 1.Disply 2.Copy 3.Append; as per the menu do the file operations 4.Exit

2038


What is the role of this pointer?

1021


What are all different types of pointers in c?

978


What do you mean by Recursion Function?

1089


Why shouldn’t I start variable names with underscores?

1028


Subtract Two Number Without Using Subtraction Operator

805


Write a program to check armstrong number in c?

1106


Which is an example of a structural homology?

1285


If i have an array 0 to 99 i.e,(Size 100) I place the values 1 to 100 randomly like a[0]=29,a[1]=56 upto array[99].. the values are only between 1 to 100. getting the array values by using scanf.. If i entered one wrong element value line a[56]=108. how can i find it.. and also how to find the missing value in 1 to 100.. and i want to replace the missing values.. any one of them know please post your answer..

2001


Differentiate between ordinary variable and pointer in c.

1126


Is there a way to switch on strings?

1050