Computer Science, asked by fearlesstora, 3 days ago

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 utkarshranger93
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