Ad Code

Responsive Advertisement

1132 - Multiples of 13

Author: Ismail Hosen

Daffodil International University





Problem Link

//Please follow from main function



#include<stdio.h>


int main()


{


    int x, y,z=0;


    scanf("%d %d", &x, &y);


    if(y>x)


    {


        while(x<=y)


        {


            if(x%13!=0){


                z+=x;


            }


            x++;


        }


        printf("%d\n", z);


    }


    else{


         while(y<=x)


        {


            if(y%13!=0){


                z+=y;


            }


            y++;


        }


        printf("%d\n", z);


    }


    return 0;


}





Post a Comment

0 Comments