Welcome to Dream.In.Code
Getting C++ Help is Easy!

Join 131,522 C++ Programmers for FREE! Get instant access to thousands of C++ experts, tutorials, code snippets, and more! There are 1,987 people online right now. Registration is fast and FREE... Join Now!




triangular fibonacci code

 
Reply to this topicStart new topic

triangular fibonacci code, could anyone help me with this plzz

batman
post 11 Oct, 2006 - 07:13 PM
Post #1


New D.I.C Head

*
Joined: 11 Oct, 2006
Posts: 1


My Contributions


CODE
#include<stdio.h>
long fibo (int no);
main()
{
int n;
clrscr();
printf("\n Enter a Number");
scanf("%d",&n);
fibo(n);
getch();
}
long fibo (int no)
{
long int i,p,p1,p2;
p1=1;
p2=1;
p=1;
for(i=1;i<=no;i++){
printf("%d",p);
if(i>=2){
p=p1=+p2;
p2=p1;
p1=p;
}


how can i make a inverted triangle fibonacci using loops..pls can u help me with this!!can u give me the syntax and codes!!!i really nid it!!!thnx

This post has been edited by Dark_Nexus: 31 Oct, 2006 - 10:05 PM
User is offlineProfile CardPM

Go to the top of the page


gregoryH
post 13 Oct, 2006 - 03:07 PM
Post #2


D.I.C Regular

Group Icon
Joined: 4 Oct, 2006
Posts: 417



Dream Kudos: 50
My Contributions


QUOTE(batman @ 11 Oct, 2006 - 08:13 PM) *

how can i make a inverted triangle fibonacci using loops..pls can u help me with this!!can u give me the syntax and codes!!!i really nid it!!!thnx


I take it you mean:
CODE

112358
11235
1123
  112
  11
   1


This post has been edited by gregoryH: 13 Oct, 2006 - 03:09 PM
User is offlineProfile CardPM

Go to the top of the page

Reply to this topicStart new topic
Time is now: 11/20/08 01:13AM

Live C++ Help!

C++ Tutorials

Reference Sheets

C++ Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month