| Current Path : /var/www/html/venkat/old/ |
| Current File : /var/www/html/venkat/old/iit2015133_4.c |
#include<stdio.h>
#include<stdlib.h>
struct node {
int val;
struct node *next;
};
int main()
{
int i,n;
struct node *head,*curr;
scanf("%d",&n);
head=NULL;
for(i=1;i<=n;i++)
{
curr=(struct node *)malloc(sizeof(struct node));
scanf("%d",&(curr->val));
curr->next=head;
head=curr;
}
curr = head;
while(curr)
{
printf(" %d",curr->val);
curr=curr->next;
}
curr=head;
while(curr)
{
if((curr->val)%2==0)
{
printf("%d",curr->val);
printf("\n");
}
curr=curr->next;
}
return 0;
}