Here is the program which accepts five numbers and display the sum of even numbers and product of odd numbers.
#include "conio.h"
#include "stdio.h"
void main()
{
int n,sum=0,mul=1,i;
printf("\nEnter numbers :\n");
for(i=0;i<5;i++)
{
scanf("%d",&n);
if(n%2==0)
sum=sum+n;
else
mul=mul*n;
}
printf("\nThe sum of even numbers is : %d",sum);
printf("\nThe multiplication of odd numbers is : %d",mul);
getch();
}
Output:
Enter numbers : 4 7 18 23 19 The sum of even numbers is : 22 The multiplication of odd numbers is : 3059 |