0

I need to write an overloaded function for a pascal triangle. I have to include another function that fits n!/((n-r)!r!), I can't figure it out. Help please! This is what I have so far:

#include "stdafx.h"
#include <iostream>
using namespace std;
int my_fib(int,int);
int x,y,j;
int main()
{
	x=0;
	y=1;
	for (int n=0; n<10; n++)
	{
		cout<<y<<",";
		y=my_fib(x,y);
		x=j;
	}
	return 0;
}
	int my_fib(int x, int y)
	{
		j=y;
		y=x+y;
		x=j;
		return y;
	}

Edited by __avd: Added [code] tags. Encase your code in: [code] and [/code] tags.

2
Contributors
1
Reply
2
Views
7 Years
Discussion Span
Last Post by __avd
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.