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
What is the difference between text and binary modes?
What is the difference between Printf(..) and sprint(...) ?
What is f'n in math?
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
FILE PROGRAMMING
Is there a way to have non-constant case labels (i.e. Ranges or arbitrary expressions)?
develop algorithms to add polynomials (i) in one variable
What are dangling pointers? How are dangling pointers different from memory leaks?
Write the control statements in C language
What does it mean when a pointer is used in an if statement?
What is sizeof int?
Is a house a mass structure?
What is the use of getchar() function?
When should a far pointer be used?
What are types of functions?