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
Differentiate abs() function from fabs() function.
What is the concatenation operator?
Write a client and server program in C language using UDP, where client program interact with the Server as given below: i) The client begins by sending a request to send a string of 8 characters or series of 7 numbers, the server sends back a characters or numbers as per the request of the client. ii) In case of series of 7 numbers: The client sends a multiplication of numbers, to the server. iii) In case of a string of 8 characters: The client sends a reverse order of string to the server.. iv) Server will send an acknowledgment to the client after receiving the correct answer
Write a C program to accept a matrix of any size. Find the frequency count of each element in the matrix and positions in which they appear in the matrix
Q.1 write a program to create binary tree 1 to 16 numbers? Q.2 write a program to creat a binary search tree for the member that is given by user?
what are # pragma staments?
Do variables need to be initialized?
What is the difference between far and near ?
What does %d do in c?
write a program to print largest number of each row of a 2D array
diff between exptected result and requirement?
What is #include called?
How to write a program for machine which is connected with server for that server automatically wants to catch the time for user of that machine?
write a program that reads lines(using getline), converts each line to an integer using atoi, and computes the average of all the numbers read. also compute the standard deviation.
Study the following C program :call_me (myvar)int myvar;{ myvar +- 5; }main(){int myvar;myvar = 3;call_me(myvar);printf("%d ",myvar);What will be printed a) 3 b) 5 c) 8 d) symbol