Wednesday, March 16, 2011

SIMPLE PATTERN USING LOOP

#include<iostream>
using namespace std;
int main()
{
char ch;                                           //character variable
ch=65;
for(int x=1;x<=5;x++)
    {
    for(int y=1;y<=x;y++)
    cout<<ch<<" ";
    ch=ch+1;
    cout<<endl;
    }
return 0;
}

The compilation of the above program....

g++ -o<the name that you want compile> <file name>





return 0;
}