SOURCE CODE:
#include<stdio.h>
#include<conio.h>
void main()
{
int a[15],even[15],odd[15],e=0,o=0,i;
clrscr();
printf("Enter 15 number:");
for(i=0;i<15;i++)
{
scanf("%d",&a[i]);
if(a[i]%2==0)
{
even[e]=a[i];
e++;
}
else
{
odd[o]=a[i];
o++;
}
}
printf("\nEven no. are:");
for(i=0;i<e;i++)
{
printf("\n%d",even[i]);
}
printf("\nOdd no. are:");
for(i=0;i<o;i++)
{
printf("\n%d",odd[i]);
}
printf("\nTotal Even Numbers are %d",e);
printf("\nTotal Odd Numbers are %d",o);
getch();
}
#include<stdio.h>
#include<conio.h>
void main()
{
int a[15],even[15],odd[15],e=0,o=0,i;
clrscr();
printf("Enter 15 number:");
for(i=0;i<15;i++)
{
scanf("%d",&a[i]);
if(a[i]%2==0)
{
even[e]=a[i];
e++;
}
else
{
odd[o]=a[i];
o++;
}
}
printf("\nEven no. are:");
for(i=0;i<e;i++)
{
printf("\n%d",even[i]);
}
printf("\nOdd no. are:");
for(i=0;i<o;i++)
{
printf("\n%d",odd[i]);
}
printf("\nTotal Even Numbers are %d",e);
printf("\nTotal Odd Numbers are %d",o);
getch();
}
No comments :
Post a Comment