2009-04-30, 01:21 AM
Russt Wrote:Find three ways to make the C program below print 20 copies of the dash character '-' by changing/adding one character:
Also:Code:int i, n = 20;
for (i = 0; i < n; i--)
{
printf("-");
}
* Find a way to get it to print exactly 21 dashes (changing 1 character).
* Find a way to get it to print exactly 1 dash (changing one character).
* Print 20 dashes with the given code, without changing it at all, but adding some preceding code.
* Print 1 dash with the given code, without changing it at all, but adding some preceding code.
I've never worked with C before xD
Solution 1
Solution 2
Solution 3

