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
A collection of data with a given structure for excepting storing and providing on demand data for multiple users a) linked list b) datastructer c) database d) preprocessor
write a program to print largest number of each row of a 2D array
Why is c called a mid-level programming language?
What are 3 types of structures?
What is the difference between text and binary i/o?
How can I automatically locate a programs configuration files in the same directory as the executable?
How do you initialize pointer variables?
What is array of structure in c?
What kind of structure is a house?
Which is better oop or procedural?
Why is a semicolon (;) put at the end of every program statement?
How many levels of indirection in pointers can you have in a single declaration?
printf(), scanf() these are a) library functions b) userdefined functions c) system functions d) they are not functions
Explain what’s a signal? Explain what do I use signals for?
What happens if a header file is included twice?