rev='made'/> name='keywords'/> name='author'/> ANURANAN: UVa Solution 10035: Primary Arithmetic

Welcome Note

Hi,
I'm Anisuzzaman Babla . I am a full stack Android Application Developer. I am working with Android for more than two years. I have completed my graduation from IIT, Jahangirnagar University. I have developed a series of commercially successful apps on Android. Moreover, 10+ of my Apps are live at Google play store. .
Thank You

UVa Solution 10035: Primary Arithmetic


#include<stdio.h>
int main()
{
long int a,b;
int count,c;
while(scanf(“%lu %lu”,&a,&b)&&a!=0&&b!=0)
             {
                     count=c=0;
                                while(a||b)
                                   {
                                    c=(a%10+b%10+c)/10;
                                     a=a/10;
                                     b=b/10;
                                     count=count+c;
                                   }
                      if(!count)
                     printf(“No carry operation.\n”);
                     else if(!(count^1))
                     printf(“1 carry operation.\n”);
                     else
                     printf(“%d carry operations.\n”,count);
            }
return 0;
}

No comments:

Post a Comment