Design a program using an array that lists even numbers and
odd numbers separately from the 12 numbers supplied by a user.

Answer Posted / valli

main()
{
int a[12],j;
printf("enter 12 numbers");
for(i=0;i<12;i++)
scanf("%d",&a[i]);
printf("even numbers\n");
for(i=0;i<n;i++)
if(a[i]%2==0)
printf("%d ",a[i]);
printf("odd numbers\n");
for(i=0;i<12;i++)
if(a[i]%2)
printf("%d ");
}
printf("%d ",a[i]);

Is This Answer Correct ?    15 Yes 16 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What does the format %10.2 mean when included in a printf statement?

1093


Disadvantages of C language.

664


What do mean by network ?

661


What is #ifdef ? What is its application?

651


Why does everyone say not to use gets?

612






What are identifiers c?

569


Can we use visual studio for c?

556


a character or group of characters that defines a register,or a part of storage a) memory b) byte c) address d) linear list

634


code for find determinent of amatrix

1521


what is event driven software and what is procedural driven software?

2019


What is the difference between mpi and openmp?

738


How do you print an address?

752


What are pointers? What are different types of pointers?

634


An arrangement of information in memory in such a way that it can be easily accessed and processed by a programming language a) string b) data structure c) pointers d) array

689


What is omp_num_threads?

587