shaadi.com

Searching...
Sunday, 13 April 2014

accept number and put odd number




// accept number and put odd number;
void main()
{
int n,sum=0,digit;
printf("enter the number");
scanf("%d",&n);
while(n>0)
{
digit=n%10;
if(digit%2!=0)
{
sum=sum+digit;
}
n=n/10;
}
{
printf("addition of odd digitsw=%d",sum);
getch();
}
}

0 comments:

Post a Comment