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
What is #include stdio h and #include conio h?
I heard that you have to include stdio.h before calling printf. Why?
Does c have enums?
What are header files why are they important?
What is derived datatype in c?
Why we not create function inside function.
FILE PROGRAMMING
What is a pointer variable in c language?
hi any body pls give me company name interview conduct "c" language only
Explain how can type-insensitive macros be created?
Why does the call char scanf work?
What is wild pointer in c?
All technical questions
2) Write a program that will help Air Traffic Control for an airport to view the sequence of flights ready for take-off. The airport can accommodate 10 flights waiting for take-off at any point in time. Each flight has a unique 3 digit numeric identifier. Each time a flight takes-off, Air Traffic Control adds a flight to the waitlist. Each time a flight is added to the waitlist, the list of flights waiting to take-off must be displayed. When a flight is cleared for take-off, Air Traffic Control removes the flight from the waitlist. Each time a flight takes-off, the list of flights waiting to take-off must be displayed. Sequence of take-off is the sequence of addition to the waitlist
What is the basic structure of c?