Monday, May 24, 2010

How do you generate the following output using C programming language??Please help me!!!!?

This is the output that is to be generated:


5


4 5


3 4 5


2 3 4 5


1 2 3 4 5

How do you generate the following output using C programming language??Please help me!!!!?
This looks like a class assignment so you should try to do it yourself. There are many ways to do this. The dirty way is to print out each line exactly like you have it. I expect your teacher wants a general algorithm. Here is some tips.





to print out something


printf ("%d\n", myNumber);





The \n is to go to next line if you don't need this don't put it in.





Have two loops. The outer loop goes from 5 to 1.


The inner loop goes from X to 5. I let you figure out what X should be.

memory cards

No comments:

Post a Comment