WAP to store ‘n’ numbers in an array and pass each array element to a function which finds if number is even or odd
WAP to store ‘n’ numbers in an array and pass each array element to a function which finds if number is even or odd
#include<stdio.h>
#include<conio.h>
void main()
{
int j,a[40];
int i,s=0;
float d;
clrscr();
void ret(int);
printf("Enter the Numbers ");
for(i=0;i<10;i++)
scanf("%d",&a[i]);
for(i=0;i<10;i++)
ret(a[i]);
getch();
}
void ret(int a[])
{
if(a[]%2==0)
printf("%d is even",a[]);
else
printf("%d is odd",a[]);
}