Write a program to input a number and check that the product of the digits and the sum of the digits are both odd numbers
Answers
Answered by
1
Answer:
Here is answer
Explanation:
#include<stdio.h>
#include<conio.h>
void main()
{
int a[50],i,even[50],odd[50],sum=0,prod=1;
clrscr();
printf("Enter 10 integers:");
for(i=0;i<10;i++)
{
scanf("%d",&a[i]);
}
for(i=0;i<10;i++)
{
if(a[i]%2==0)
{
even[i]=a[i];
prod=prod*even[i];
}
}
for(i=0;i<10;i++)
{
if(a[i]%2!=0)
{
odd[i]=a[i];
sum=sum+odd[i];
}
}
printf("\nSum of odd numbers is %d\n",sum);
printf("\nproduct of even numbers is %d\n",prod);
getch();
}
Mark me Brainliest
Similar questions
Computer Science,
1 day ago
Math,
1 day ago
History,
1 day ago
Computer Science,
3 days ago
English,
3 days ago
English,
8 months ago
Physics,
8 months ago