Click here to Skip to main content
15,891,033 members
Please Sign up or sign in to vote.
1.00/5 (4 votes)
See more:
" - " ; mean Space

n=3

--*
-**
***

n= 5
----*
---**
--***
-****
*****
Posted
Updated 15-Feb-20 6:34am
v2
Comments
Richard MacCutchan 11-Dec-10 5:49am    
If you realloy cannot figure out the algorithm for something like this, then you need to spend more time studying your language of choice.
Tarun.K.S 11-Dec-10 11:53am    
it would require two or more for loops to achieve this. Try it! it ain't that tough. you can search on google too.

My vote of one:

Please read the FAQs: We do not do your homework (and this is a pretty obvious homework task: I set it for my VB students) for you. For one thing, you won't benefit from it, for another nor will we.

As Richard MacCutchan sates, if you cannot do this, yourself then you need to practise / study a bit more. Honsetly, if you get it done, the sense of satisfaction should be more than worth the effort.
If you don't want to (or after much effort you still can't ) do this then IT isn't the career for you.
 
Share this answer
 
.MODEL SMALL
.STACK  50H
.DATA
    NL  DB  0DH, 0AH, '$'         ; NL = NEXT LINE
.CODE
MAIN PROC
    MOV AX, @DATA
    MOV DS, AX
    MOV CX, 5
    MOV BX, 1
    FOR_1:
        PUSH    CX
        MOV DL, 20H    ; 20H IS ASCII CODE FOR SPACE
        MOV AH, 2
        FOR_2:
            INT 21H    ; PRINTING SPACES
        LOOP    FOR_2
        MOV CX, BX
        MOV DL, '*'
        MOV AH, 2
        FOR_3:
            INT     21H    ; PRINTING STARS
        LOOP    FOR_3
        LEA DX, NL
        MOV AH, 9
        INT     21H    ; MOVE CURSOR TO THE START OF NEXT LINE
        INC BX
        POP CX
    LOOP    FOR_1
    MOV AH, 4CH
    INT         21H
MAIN ENDP
    END MAIN
 
Share this answer
 
Comments
Dave Kreskowiak 15-Feb-20 12:54pm    
Doing someones homework assignment for them, 10 years later, helps nobody.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900