pankajkompella / Hackerrank-SI-Basic

My submissions for Hackerrank Smart Interviews' (BASIC).

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

this might help

fiendvalak opened this issue · comments

#include <stdio.h>
#include <string.h>
#include <math.h>
#include <stdlib.h>

int main()
{
int i,j,s,x,n;
scanf("%d",&n);
for(i=1; i<=n; i++)
{
s=n-1;
x=i;
for(j=1;j<=i;j++)
{
printf("%d ",x);
x+=s;
s--;
}
printf("\n");
}
return 0;
}

What question is this code for ?