Printing Shapes Using Ncurses.h In Linux

closed account (NT4iE3v7)
Can Any One Give Me The Source Code For This?.

AAAASSSS
AAASSS
AASS
AS
CV
CCVV
CCCVVV
CCCCVVVV
Last edited on
Is this an assignment? It is not something you would normally bother to use ncurses for. Have a go and come back with you code if you get stuck, someone will help you out. You need to at least make an attempt.
closed account (NT4iE3v7)
Ya.I tried but could not get the out put.teacher said u have to use 4 netsted FOR loops.i printed sss and when i trying to print AAA , sss were vanish from the screen,hmmmmmmmmmmm
Post your attempt here and someone will have a look to see where you're going wrong
closed account (z05DSL3A)
The placing of one loop inside the body of another loop is called nesting. When you "nest" two loops, the outer loop takes control of the number of complete repetitions of the inner loop. While all types of loops may be nested, the most commonly nested loops are for loops.

So you need four nested for loops, you have a descending sequence and an ascending sequence, so there are two potential outer loops...

i printed sss and when i trying to print AAA , sss were vanish from the screen

As bnbertha said you would have to post code for us to see the error but my guese would be that as you are using Ncurses.h you probably make calls to move the current cursor position, you could just be over writing the output by moving the cursor to a previously used posistion.


HTH
Topic archived. No new replies allowed.