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
How to delete a node from linked list w/o using collectons?
Explain how can you restore a redirected standard stream?
Write a code to achieve inter processor communication (mutual exclusion implementation pseudo code)?
What is the symbol indicated the c-preprocessor?
disply the following menu 1.Disply 2.Copy 3.Append; as per the menu do the file operations 4.Exit
What is the role of this pointer?
What are all different types of pointers in c?
What do you mean by Recursion Function?
Why shouldn’t I start variable names with underscores?
Subtract Two Number Without Using Subtraction Operator
Write a program to check armstrong number in c?
Which is an example of a structural homology?
If i have an array 0 to 99 i.e,(Size 100) I place the values 1 to 100 randomly like a[0]=29,a[1]=56 upto array[99].. the values are only between 1 to 100. getting the array values by using scanf.. If i entered one wrong element value line a[56]=108. how can i find it.. and also how to find the missing value in 1 to 100.. and i want to replace the missing values.. any one of them know please post your answer..
Differentiate between ordinary variable and pointer in c.
Is there a way to switch on strings?