Writting code in C, please help me you fuckign faggots I hate programming

Writting code in C, please help me you fuckign faggots I hate programming

A sequence an is given with the following rule:

an+2 = − 2 an+1 + 3 an, a0 = 2, a1 = −1.
Write a C program to compute a17.

you must be fucking dumb

fuck you jobless programmer, help me because this shit is fucking gay and impossible, im a mechanicl engineer, not a virgin programmer to code bouncing anime tits

i cant help big dummies like you.
Mr mechanicl Engineer

Just make a for loop going from n= 0 to 15, in which you calculate an+2

fuck guys, write the code and then maybe I could see the cancer this fucking programming shit wants me to learn :(

Do your own fucking homework kid

and you call yourself an engineer.

pathetic fucking loser

>you will never be this retarded
good to know this

mortal dickhead

fuck all of you programming nerds, im sure you all regret choosing computer science rather than a real major like mechanical eng

TITS or GTFO!!!

"WAAAAH"
"WAAAAH"
"WAAAAAAAAH"

ill just kms irl its ok guys, thank for the help

Livestream?

in JavaScript (cant remember much C - are recursive functions allowed there?)

let comp = (a) => {
if (a ==0)
return 2;

if (a == 1)
return -1;

return -2 * comp(a-1) + 3 * comp(a-2);
}

Just verified that it works. if you copy/paste it into your developer console, you should see output like:

comp(0);
2
comp(1);
-1
comp(2);
8
comp(3);
-19

comp(17)
-96855121

You sir have just excluded yourself from getting help by saying this. That is not a nice thing to say to people you want the help of

int function(an1, an, n) {
if (n!=0)
function(3*an-2*an+1, an1,n-1) ;
else
return an1;
}

Call the function with function(-1,2,17).

>be op
>be shitty mechanical engineering student
>can't get homework done because too dumb
>can't find friends who can help cause weeb
>can't google examples for this simple, classic algorithm
>go online and insult programmers after asking for help
>too pussy to livestream his own death after threatening suicide like a camwhore

Nigga just drop out. Mechanical Engs are naturally quite good at such simple programming logic. It's the advanced concepts they have a hard time with because no practice or need. But you, man you shouldnt even be in the program because your actions today have clearly exposed your ineptitude to becoming an actual engineer. You are worse than scum.

In my experience most engineers can't even read a fucking tape measure.

i respond well to rudeness.

// not optimized, recursive
int sequence(int a) {
if(a == 0) return 2;
if(a == 1) return -1;
return 2*sequence(a-1) + 3*sequence(a-2);
}

for payment pls post dick (im a gurl)

>(im a gurl)
tits or gtfo