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
What is f'n in math?
What is p in text message?
What is the best way to store flag values in a program?
Why isnt there a numbered, multi-level break statement to break out
What is array in C
Explain the properties of union. What is the size of a union variable
How can a process change an environment variable in its caller?
How can you invoke another program from within a C program?
write a program to find out prime number using sieve case?
What is meant by high-order and low-order bytes?
Is a house a mass structure?
can we change the default calling convention in c if yes than how.........?
What is a sequential access file?
How do we open a binary file in Read/Write mode in C?
Why we use void main in c?