## Skill Subsist Impulse Ltd Interview Question for Analysts

Country: India
Interview Type: Written Test

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

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

int fib(int n)
{
if(n==0 || n==1)
return n;
else
return fib(n-1)+fib(n-2);
}

int main()
{
int n,i;
printf("Enter a number.\n");
scanf("%d",&n);
for(i = n ; i >=0 ; i--)
printf("%d ",fib(i));
return 0;
}``````

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

void fib(int x, int N, int prv1, int prv2) {
if (x<=N) {
fib(x+1, N, prv1+prv2, prv1);
printf("%d\t", prv1+prv2);
}
}

int main(void) {
int Nth = 10; // Starting from 0th to Nth

if (Nth > 1) {
fib(2, Nth, 1, 0);
}
if (Nth > 0) {
printf("1\t"); //1st fib number
}
if (Nth > -1) {
printf("0\t"); //0th fib number
}
return 0;
}

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

void fib(int x, int N, int prv1, int prv2) {
if (x<=N) {
fib(x+1, N, prv1+prv2, prv1);
printf("%d\t", prv1+prv2);
}
}

int main(void) {
int Nth = 10; // Starting from 0th to Nth

if (Nth > 1) {
fib(2, Nth, 1, 0);
}
if (Nth > 0) {
printf("1\t"); //1st fib number
}
if (Nth > -1) {
printf("0\t"); //0th fib number
}
return 0;
}

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

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

int fib(int n)
{
if(n==0 || n==1)
return n;
else
return fib(n-1)+fib(n-2);
}

int main()
{
int n,i;
printf("Enter a number.\n");
scanf("%d",&n);
for(i = n ; i >=0 ; i--)
printf("%d ",fib(i));
return 0;
}

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.