how can i convert this into a struct? the program is prnting all the even nos

void main()
{
int num[5],even[5],count,j=0;
clrscr();

printf("Enter  5 numbers\n");
for(count=0;count<5;count++)
{
scanf("%d",&num[count]);
}


for(count=0;count<5;count++)
{
  if((num[count]%2)==0)
  {
   even[j]=num[count];
   j++;
  }
}

printf("EVEN:\n");
for(count=0;count<j;count++)
{
printf("%d\t",even[count]);
}

getch();
}

Recommended Answers

All 3 Replies

Member Avatar for MonsieurPointer

how can i convert this into a struct?

What do you mean? What do you want in the structure? Please elaborate.

Do you want to convert the program into structure one ???

Put the variables in a structure

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.