About Me

About Me : I have been working as a Software Engineer for various international companies for four years.Currently, I am working as a full stack Javascript developer in Petronas(Malaysia).

Skills

Skills • Javascript •Typescript •Python •C •Java •ReactJs • Redux • VueJs • NestJs • React Testing Library • Django• PostgreSQL • MySQL • NodeJs • Git • Docker • Jira • Visual Studio Code • Slack

শনিবার, ৮ ফেব্রুয়ারী, ২০১৪

UVA :10035 - Primary Arithmetic

LINK #
#include <stdio.h>
int main()
{
    long long a,b,c,x,y,sum;
    while(scanf("%lld %lld",&a,&b)==2){
        if(a==0 && b==0)
            break;
           sum=0;
           c=0;
        while(1){
     if(a==0&&b==0) break;
            x=a%10;
            y=b%10;
            sum=sum+x+y;
            if(sum>9){
                sum=1;
                c++;
        }else{
        sum=0;
        }
            a=a/10;
            b=b/10;

        }

       if(c==0){
        printf("No carry operation.\n");
       }else if(c==1){
        printf("%lld carry operation.\n",c);
       }else{
       printf("%lld carry operations.\n",c);
       }

    }
    return 0;
}

কোন মন্তব্য নেই:

একটি মন্তব্য পোস্ট করুন