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
How can you read a directory in a C program?
What are the usage of pointer in c?
What are the types of type qualifiers in c?
What is .obj file in c?
Is boolean a datatype in c?
What are the features of c languages?
is it possible to create your own header files?
What is pragma c?
to print the salary of an employee according to follwing calculation: Allowances:HRA-20% of BASIC,DA-45% of BASIC,TA-10%. Deductions:EPF-8% of BASIC,LIC-Rs.200/-Prof.Tax:Rs.200/- create c language program?
What are extern variables in c?
Explain how can a program be made to print the line number where an error occurs?
Is struct oop?
List the variables are used for writing doubly linked list program.
How would you obtain the current time and difference between two times?
How can I copy just a portion of a string?