#include<iostream.h>
#include<conio.h> // non standard libary function for clrscr() and getch()
void main()
{
clrscr();
int i,j;
for(i=0;i<=10;++i) // first loop
{
for(j=0;j<=i;++j) // second nested loop
cout<<"*";
cout<<"\n";
}
getch();
}
I guess it is correct...
As you may know conio is a non standard h file so please use any alternate for clrscr() and getch()
cheers,
cyber dude
iostream.h is also nonstandard. Just delete the ".h" at the end to use the correct, standard iostream header file.
Also, I'm not sure why you would need to clear the screen before doing anything. Otherwise, your code is fine.
srry didint read the question properly thats whyI ended up with this
*
**
***
****
*****
******
*******
********
*********
**********
***********
@daleth
to understand clearing screen before running run the program continueslly without using clrscr();