Dev Skill DCP-117: Not Easy But Not Hard Solution


Problem Link
Dev Skill DCP-117: Not easy but not hard solution
#include<stdio.h>
int main()
{
    int t,j;
    long long int n;
    scanf("%d",&t);
    j=0;
    while(j<t)
    {
        scanf("%lld",&n);
        n=(n*(n+1))/2;
        printf("%lld\n",n);
        j++;
    }
    return 0;
}

No comments

Theme images by enjoynz. Powered by Blogger.