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
How do you convert strings to numbers in C?
What is c language used for?
What is unary operator?
How can I sort more data than will fit in memory?
Stimulate calculator using Switch-case-default statement for two numbers
how can i access hard disk address(physical address)? are we access hard disk by using far,near or huge pointer? if yes then please explain.....
What is union and structure?
A variable that is defined in a specified portion of a program but can be used throughout the program a) global variable b) local variable c) character d) none
What is a newline escape sequence?
how to find binary of number?
What is the 'named constructor idiom'?
What are runtime error?
Why do we use header files in c?
What is break statement?
To print the pattern 1 2 3 4 5 10 17 18 19 6 15 24 25 20 7 14 23 22 21 8 13 12 11 10 9