Print The Tringle in C++ Programming Language Using Userdefine Function

#include<iostream.h>
#include<conio.h>
class tri
{
    private:
         int no,i,j;
    public:
         void getdata();
         void putdata();
};
void tri :: getdata()
{
   cout<<"\nEnter number for Print Tringle=>";
   cin>>no;
}
void tri :: putdata()
{
    for(i=1;i<=no;i++)
    {
      for(j=1;j<=i;j++)
      {
     cout<<"*";
      }
      cout<<"\n";
     }
}

void main()
{
    clrscr();
    tri t;
    t.getdata();
    t.putdata();
    getch();
}
Print The Tringle in C++ Programming Language Using Userdefine Function Print The Tringle in C++ Programming Language Using Userdefine Function Reviewed by Unknown on 6:11:00 PM Rating: 5

No comments:

Powered by Blogger.