How To Write Simplest C++ Code


Write the following code in C++ language for specific given star pattern, use same logic for others..


Code:

#include<iostream.h>
void main()
{
                for(int F=5,A;F>=1;F--)
                {
                                for(A=5-F;A>0;A--)
                                                cout<<"\t";
                                for(A=5-F;A<5;A++)
                                                cout<<"*\t";
                                cout<<endl;
                }
                cout<<"\n\n\n\n\n\n";
}



Comments and suggestions are highly appreciated . .

Comments