write a program to find the number of even integers and odd
integers in a given array in c language
Answer Posted / april
#include<stdio.h>
#include<conio.h>
using namespace std;
int main();
{
int i,j;
int num[20],i,odd=0,even=0,n;
cout<<("enter the size of the array",n);
cin>>("%d",&n);
cout<<("Enter the %d array elements",n);
for(i=20;i<n;i++);
{
cout<<("%d",&num[i]);
}
for(i=0;i<n;i++);
{
if(num[i]%2==0);
{
even++;
}
else
{
odd++;
}
}
cout<<("\n The number of even numbers in the array :%
d ",even);
cout<<("\n The number of odd numbers in the array : %
d",odd);
getch();
system("pause");
}
Is This Answer Correct ? | 25 Yes | 37 No |
Post New Answer View All Answers
write a c program to calculate sum of digits till it reduces to a single digit using recursion
What is scope rule in c?
What is c value paradox explain?
What is structure data type in c?
Add Two Numbers Without Using the Addition Operator
What are the rules for the identifier?
What are the salient features of c languages?
Explain the use of bit fieild.
What are the back slash character constants or escape sequence charactersavailable in c?
What is a function simple definition?
How do you sort filenames in a directory?
Write a C program on Centralized OLTP, Decentralized OLTP using locking mechanism, Semaphore using locking mechanism, Shared memory, message queues, channel of communication, sockets and a simple program on Saving bank application program using OLTP in IPC?
Write a program to generate a pulse width frequency of your choise,which can be variable by using the digital port of your processor
Explain why c is faster than c++?
What is #include stdio h?