## Skill Subsist Impulse Ltd Interview Question for Software Developers

Country: India

Comment hidden because of low score. Click to expand.
2
of 2 vote

``````#include<stdio.h>

double fact(int n)
{
if(n<=1)
return 1;
return n*fact(n-1);
}

int main()
{

int i=0, num =0, n=0,k=0;

printf("enter the no of rows\n");
scanf("%d",&num);

n = num -1;
for(i=0;i<num;i++)
{
for(k=n;k>i;k--)
printf(" ");
for(k=0;k<=i;k++)
{

printf(" %.0f", fact(i)/(fact(i-k)*fact(k)));

}
printf("\n");

}
return 0;
}``````

Comment hidden because of low score. Click to expand.
2
of 2 vote

``````#include<stdio.h>

double fact(int n)
{
if(n<=1)
return 1;
return n*fact(n-1);
}

int main()
{

int i=0, num =0, n=0,k=0;

printf("enter the no of rows\n");
scanf("%d",&num);

n = num -1;
for(i=0;i<num;i++)
{
for(k=n;k>i;k--)
printf(" ");
for(k=0;k<=i;k++)
{

printf(" %.0f", fact(i)/(fact(i-k)*fact(k)));

}
printf("\n");

}
return 0;
}``````

Comment hidden because of low score. Click to expand.
2
of 2 vote

You probably just want to replace the factorial function with something like this :

``````// ZoomBA
FACTORIALS = list(1,1,2,6,24)
def factorial ( n ){
if ( n <= size(FACTORIALS) ) return FACTORIALS[n]
for ( [size(FACTORIALS):n+1] ){
FACTORIALS += FACTORIALS[-1] * \$
}
FACTORIALS[n]
}
println( factorial(10) )``````

Name:

Writing Code? Surround your code with {{{ and }}} to preserve whitespace.

### Books

is a comprehensive book on getting a job at a top tech company, while focuses on dev interviews and does this for PMs.

### Videos

CareerCup's interview videos give you a real-life look at technical interviews. In these unscripted videos, watch how other candidates handle tough questions and how the interviewer thinks about their performance.