#include < stdio.h >
#include < conio.h >
#define BILMAX 10
int main()
{
int num[BILMAX],i;
printf("insert 10 number and separated by space:
");
for (i = 0;i<10;i++)
{
scanf("%d",&num[i]);}
printf("
Even Number :
");
for(i = 0; i < 10; i++)
{
if(num[i] % 2==0)
printf("%d",num[i]);
}
printf("
Odd Number :
");
for(i = 0;i < 10; i++)
{
if(num[i] % 2 !=0)
printf("%d",num[i]);
}
getch();
return 0;
}
my output is like this
insert 10 number and separated by space:
1 2 3 4 5 6 7 8 9 10
Even Number:
246810
Odd Number:
13579
i want my output like this
insert 10 number and separated by space:
1 2 3 4 5 6 7 8 9 10
Even Number:
2 4 6 8 10
Odd Number:
1 3 5 7 9
i want my output have a space.
Please help
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…