can u pls tell me whr i have gone rong------i have got 2errorz...

#include<iostream.h>
#include<conio.h>


void main()
{
cout<<"\n\n\n\tPATTERN\n\\n\n\t" ;


for(int i=1; i<=9; i++);
{for (int j=1;j<=i; j++);
cout<<i;
}


getch();
}

Edited 3 Years Ago by happygeek: fixed formatting

Remove the semicolon after the loops.
that is

#include<iostream.h>
#include<conio.h>

void main()
{
cout<<"\n\n\n\tPATTERN\n\n\n\t" ;

for(int i=1; i<=9; i++)
{
  cout<< endl;  
  for (int j=1;j<=i; j++)
    cout<<i;
}

getch();
}

i dont understand watz rong w dis.........

#include<iostream.h>
#include<conio.h>


void main()
{
cout<<"\n\n\n\tPATTERN\n\\n\n\t" ;


for(int i=1; i<=9; i++)
{


for (int j=1;j<=i; j++);
cout<<"\n\n\n\";
cout<<i;


getch();
}

Edited 3 Years Ago by happygeek: fixed formatting

else it will print 1223334445555...
to print like this
1
22
333
... i included that line.
Also u have to learn what happend if ypu put a semicolon at the end of for loop. Avoid mistakes.
You should Improve findout solutions urself.(especially if problems are so simple)

cout<< endl;....dis s a code i havnt studied!!... s dere any substitute for this..i have just started C++ day before yesterday so i havnt learnt this....is there any way 2 print this.........
1
22
333
4444
........................without using cout<<endl;?..plz do reply...thanks alot for your haelp n sorry for any inconvinience caused by this..

cout<<endl;
cout<<"\n";
both the above statements are same. Both are used to put a new line.

wont dis one do?........................

#include<iostream.h>
#include<conio.h>


void main()
{
cout<<"\n\n\n\tPATTERN\n\n\n\t";  //Pattern is placed outside the loop


for(int i=1; i<=5;i++)


{cout<<"\n\n\t";       //cout s placed here so dat it comes1 step below
for (int j=1;j<=i; j++)
cout<<i;
}


getch();
}

Edited 3 Years Ago by happygeek: fixed formatting

Although the problem might be solved, I strongly suggest that you read these links:

code tags
void main()
getch()
code formatting

And last but not least: I suspect that you're using the Turbo C++ compiler? Replacing it with a 'modern' compiler would be a good idea. That way you'll learn C++ the standard way, not the turbo way. Turbo was a good compiler back in the day, but that day was a few years back...
Here are some newer (free) compilers:

Visual Studio (my personal fav)
Bloodshed Dev-c++
code::blocks

This article has been dead for over six months. Start a new discussion instead.