**
***
****
*****
- Start first loop with a variable name lets say "a" from 1 to5 and increment it by 1 and write starting curly braces of it.
- Start second loop with a variable name lets say "b" from 1 to less then a and increment it by 1 and this loop should be the nested of first loop.
- Write starting curly braces of second loop and then write output statement which prints * like ....................print("*"); ( note: don't write println here) and then write ending curly braces of second loop.
- Write statement for line break outside the body of second loop and inside the body of first loop like ...................println(); and then write ending curly braces of the first loop.
****
***
**
*
- Start first loop with a variable name lets say "a" from 1 to 5 and increment it by 1 and write starting curly braces of it.
- Start second loop with a variable name lets say "b" from 5 to greater then a and decrement it by 1 and this loop should be the nested of first loop.
- Write starting curly braces of second loop and then write output statement which prints * like ....................print("*"); ( note: don't write println here) and then write ending curly braces of second loop.
- Write statement for line break outside the body of second loop and inside the body of first loop like ...................println(); and then write ending curly braces of the first loop.
**
***
****
*****
- Start first loop with a variable name lets say "a" from 1 to 5 and increment it by 1 and write starting curly braces of it.
- Start second loop with a variable name lets say "b" from 5 to greater then a and decrement it by 1 and this loop should be the nested of first loop.
- Write starting curly braces of second loop and then write output statement which prints one space like ....................print(" "); ( note: don't write println here) and then write ending curly braces of second loop.
- Start third loop with a variable name lets say "c" from 1 to less then a and increment it by 1 and this loop should also be the nested of first loop but not of second loop.
- Write starting curly braces of third loop and then write output statement which prints * like ....................print("*"); ( note: don't write println here) and then write ending curly braces of third loop.
- Write statement for line break outside the body of second loop and third loop but inside the body of first loop like ...................println(); and then write ending curly braces of the first loop.
****
***
**
*
- Start first loop with a variable name lets say "a" from 1 to 5 and increment it by 1 and write starting curly braces of it.
- Start second loop with a variable name lets say "b" from 1 to less then a and increment it by 1 and this loop should be the nested of first loop.
- Write starting curly braces of second loop and then write output statement which prints one space like ....................print(" "); ( note: don't write println here) and then write ending curly braces of second loop.
- Start third loop with a variable name lets say "c" from 5 to greater then a and decrement it by 1 and this loop should also be the nested of first loop but not of second loop.
- Write starting curly braces of third loop and then write output statement which prints * like ....................print("*"); ( note: don't write println here) and then write ending curly braces of third loop.
- Write statement for line break outside the body of second loop and third loop but inside the body of first loop like ...................println(); and then write ending curly braces of the first loop.
No comments:
Post a Comment