0
Develop a C Program to accept a number & print the multiplication result of its even digits. Example: Input: -1234 Expecte
Want to write the program of this
4 odpowiedzi
+ 4
Sarthak Rai ,
, before we can help you, you should show us your attempt first. if you have not done a try by yourself upto now, please do so. Put your code in playground and link it here.
thanks!
+ 2
Sarthak Rai the program you shared seems to solve the problem you mentioned in question title then what's the problem ?
0
#include<stdio.h>
int main()
{
int num, evenProd=1, rem ,temp;
printf("Enter any number: ");
scanf("%d", &num);
while(num>0)
{
rem = num%10;
if(rem%2==0)
evenProd = evenProd * rem ;
num=num/10;
}
printf("\nProduct of Even Digit = %d", evenProd );
return 0;
}
0
I'm doing that only but if I'm using else for odd it is coming for each odd no not one for all odd