Your IP : 216.73.216.40


Current Path : /var/www/html/venkat/old/old/
Upload File :
Current File : /var/www/html/venkat/old/old/bim2015007_4.c

#include<stdio.h>
#include<stdlib.h>

struct node
{
	int data;
	struct node *next;
};
struct node *head;
void insert(int x)
{
	struct node *temp=(struct node *)malloc(sizeof(struct node));
	temp->data=x;
	temp->next=head;
	head=temp;
}
print()
{
	int k;
	struct node *temp=head;
	printf("List is:");
	while(temp!=NULL)
	{
		k=temp->data;
		if(k%2==0)
			printf("\t%d",k);
		temp=temp->next;
	}
	printf("\n");
}
int main()
{
	head=NULL;
	printf("enter how many data:");
	int i,n,x;
	scanf("%d",&n);
	for(i=0;i<n;i++)
	{
		printf("enter data:");
		scanf("%d",&x);
		insert(x);
	}
	print();
	return 0;
}