write a C program to Read a number . find sum of digit at even position in a number and
multiplication of digit at odd position in a number.
Answers
Answered by
0
C program
Explanation:
#include<stdio.h>
#include<conio.h>
void main()
{
int num, i, count=0, sum=0, multi=1;
printf("Enter a number");
scanf("%d",&num);
while(num!=0)
{
digi=num%10;
count++;
if(count/2==0)
sum=sum+digi;
else
multi=multi*digi;
num=num/10;
}
printf("Sum of digit at even position in a number is %d,",sum);
printf("Multiplication of digit at odd position in a number is %d,",multi);
}
Similar questions