14,697,191 members
See more:
am enetring a value to a text box
eg: 4 ( only 1-9 digits)

i want to use this value as the upper bound
for creating

if i give 4 means want structure like as follows
for adding t a list in this order
12,13,23
14,24,34

5 means

12,13,23,
14,24,34
15,25,35,45
Posted
Updated 24-Jan-13 0:12am
v3
Sushil Mate 24-Jan-13 4:31am

school assignment?

yeh, I thing so :)
PIEBALDconsult 24-Jan-13 4:39am

Looks like combinations of { 1 , 2 , 3 , 4 } taken two at a time. There are several relevent articles here; one is mine. But you won't learn if you don't figure it out yourself. You learn from the journey; not the destination.
P_Dash 24-Jan-13 4:50am

These are basic level questions.
If you can't do this on your own, How can you come to learn programming ??
These are the basics of any programming language.

So think & try by yourself & I know you will crack it.

## Solution 1

'C' Language
```int s = 12;
int i,j;
for(i=3;i>=1;i--)
{
for( j=s; j<s+i; j++)
{
printf("%d",j);
}
s = s+11;
printf("\n");
}```

'C#' Language

```class Program
{
static void Main(string[] args)
{
int s = 12;
int i,j;
for(i=3;i>=1;i--)
{
for( j=s; j<s+i; j++)
{
Console.Write(j.ToString());
}
s = s+11;
Console.Write("\n");
}
}
}```
v5
PIEBALDconsult 24-Jan-13 4:58am

I'm hoping that won't compile.
Azziet 24-Jan-13 5:02am

why? check this in your c editor

PIEBALDconsult you are hoping exactly right... inner for loop has syntax error
PIEBALDconsult 24-Jan-13 5:06am

Have you checked it in yours?
Azziet 24-Jan-13 5:07am

that was just typing error...i've improved the solution
Azziet 24-Jan-13 5:07am

that was just typing error...i've improved the solution
PIEBALDconsult 24-Jan-13 13:01pm

The compiler takes offense at "typing errors".