write a program to print sum of even number and product of odd number between range given by user?
Answers
Answered by
0
Explanation:
int main()
{
int a,b,i,sum=0, product=0;
scanf("%d%d",&a,&b);
for(i=a;i<=b;i++)
{
if(i%2==0)
sum+=i;
else
product*=i;
}
printf("%d %d",sum,product);
}
Similar questions