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 : 10783 - Odd Sum

Link : Odd Sum
#include <stdio.h>
int main()
{
   int i,j,t,a,b,sum;
   scanf("%d",&t);
    for(j=1;j<=t;j++){
            sum=0;
        scanf("%d %d",&a,&b);
        if(a>b){
    for(i=a;i>=b;i--){
       if(i%2!=0){
        sum+=i;
       }
    }
    printf("Case %d: %d\n",j,sum);
        }
        else  {
      for(i=a;i<=b;i++){
       if(i%2!=0){
        sum+=i;
       }
    }
    printf("Case %d: %d\n",j,sum);

        }

   }
    return 0;
}


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

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