write a program to find the number of even integers and odd
integers in a given array in c language

Answer Posted / rahul khare

#include<stdio.h>
#include<conio.h>
void main()
{
int a[10],even=0,odd=0,i;
for(i=0;i<9;i++)
{
if(a[i]%2==0)
{
printf("%d\t",a[i]);
even++;
}
else
{
printf("%d\t",a[i]);
odd++;
}
}
printf("Total no of Even found is=%d",even);
printf("Total no of Odd found is=%d",odd);
getch();
}

Is This Answer Correct ?    134 Yes 75 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between text and binary modes?

650


What is the difference between Printf(..) and sprint(...) ?

792


What is f'n in math?

623


any limit on the number of functions that might be present in a C program a) max 35 functions b) max 50 functions c) no limit d) none of the above

636


FILE PROGRAMMING

1781






Is there a way to have non-constant case labels (i.e. Ranges or arbitrary expressions)?

585


develop algorithms to add polynomials (i) in one variable

1747


What are dangling pointers? How are dangling pointers different from memory leaks?

629


Write the control statements in C language

653


What does it mean when a pointer is used in an if statement?

606


What is sizeof int?

641


Is a house a mass structure?

644


What is the use of getchar() function?

632


When should a far pointer be used?

607


What are types of functions?

570