Jinson Jacob -3 Newbie Poster
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
cout<<"            Floyd's Triangle " <<endl<<endl;
cout<<"Enter a number till which floyd's triangle is required : ";
int max;
cin>>max;
for(int i=1,num=1;num<=max;i++)
{
for(int j=1;j<=i;j++,num++)
{
cout<<" "<<num;
}
cout<<endl;
}
getch();
}
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.