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
What does the c preprocessor do?
What is a function in c?
What does void main () mean?
Is int a keyword in c?
What is realloc in c?
Between macros and functions,which is better to use and why?
How can you draw circles in C?
Is c dynamically typed?
How can I open files mentioned on the command line, and parse option flags?
What are the uses of null pointers?
if (i = 0)printf ("True"); elseprintf("False"); Under what conditions will the above print out the string "True" a) Never b) Always c) When the value of i is 0 d) all of the above
Who is the founder of c language?
a) Identify the following declarations. Ex. int i (integer variable) float a[l0](array of 10 real nos) int (*f())() void *f int (*f()) [] void *f int f[] [] [] char *(*f) () int (*f[]) [] float(*f) [] [] float **f int ******f
In a switch statement, what will happen if a break statement is omitted?
What are multidimensional arrays?