Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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

Answer Posted / atul shukla

in list 12 all can be even or all can be odd so it require
3 array of same size

#include<stdio.h>
void main()
{
int a[12],even[12],odd[12],i,c=0,d=0;
printf("enter 12 numbers");
for(i=0;i<12;i++)
scanf("%d",&a[i]);
for(i=0;i<12;i++)
(n[i]%2==0)?even[c++]=a[i]:odd[d++]=a[i];
printf("seprate list of odd entries");
for(i=0;i<=d;i++)
printf("%d",odd[i]);
printf("seprate list of even entries");
for(i=0;i<=d;i++)
printf("%d",even[i]);
}

Is This Answer Correct ?    2 Yes 6 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain how do you search data in a data file using random access method?

1069


Write a code to achieve inter processor communication (mutual exclusion implementation pseudo code)?

1072


Write the Program to reverse a string using pointers.

967


Write a program, where i have a grid with many cells, how many paths are possible from one point to other desired points.

1185


How to declare pointer variables?

1161


How can you check to see whether a symbol is defined?

1044


Why are algorithms important in c program?

1067


How to throw some light on the b tree?

1018


Can we change the value of #define in c?

956


What is string length in c?

1023


typedef struct{ char *; nodeptr next; } * nodeptr ; What does nodeptr stand for?

1584


Why is extern used in c?

1050


Is null always defined as 0(zero)?

1041


How arrays can be passed to a user defined function

965


How can I direct output to the printer?

1271