/* Note: Tested with TurboC++ compiler ONLY */ /* To print the above pattern or output using asm statement */ #include #include void main(void) { int i=1,j; clrscr(); // asm statement doesn't end with semicolon (starts with 'asm' keyword) asm mov ax,i // Move the value of 'i' to accumulator (ax) Loopi:j=0; Loopj:printf("*"); // Print asterisk (*) j=j+1; asm mov cx,j // Increment the counter : Inner Loop asm cmp cx,i asm jnz Loopj // Terminate the Inner Loop if Inner Loop counter = Outer Loop counter i=i+1; printf("\n"); asm mov ax,i // Increment the counter : Outer Loop asm cmp ax,6 asm jnz Loopi // Terminate the Outer Loop if counter = 6 getch(); } /* End of main */