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
How can I open files mentioned on the command line, and parse option flags?
Write a program to swap two numbers without using the third variable?
Explain zero based addressing.
general for is %wd,f-d; in this system "w" means a) 'w' represent total width of digits b) 'w' represent width which includes the digits before,after decimal place and the decimal point c) 'w' represent width which includes the digits before only d) 'w' represent width after decimal place only
How is null defined in c?
struct screen_pos{ int row, col } ;move_right(cursor)struct screen_pos *cursor;{ cursor.col++; } /* This statementhas a syntax error */What is the correct statement a) cursor.col = cursor.col + 1; b) col.cursor++; c) *cursor.col++; d) pointer
what is the function of pragma directive in c?
What is const volatile variable in c?
Which are low level languages?
Given two strings S1 and S2. Delete from S2 all those characters which occur in S1 also and finally create a clean S2 with the relevant characters deleted.
Explain how can I write functions that take a variable number of arguments?
Do you know the difference between exit() and _exit() function in c?
Explain how can you be sure that a program follows the ansi c standard?
How can I list all of the predefined identifiers?
I need previous papers of CSC.......plz help out by posting them.......