program to display following numeric pattern.

//program to display following numeric pattern.
//      12345
//      1234
//      123
//      12
//      1
void main()
int i,j;
logics in mind:
1)we have to display 1,2,3,4,5 so we use loop.
 2)since the displays are in repetitive form ,,we set up the loop in nested form such that
        internal loop executes 5 times with display of numbers(above).
3)First loop(outer) takes value 5 and assigns to inner.The inner executes 5 times with display.
4)next time, the outer loop takes the value 4 and transfers to inner loop, it displays again and again.
and it goes on


No comments:

Post a Comment