Re: without loop printing 1 to n
- From: Random832 <random@xxxxxxxxxxxxx>
- Date: 22 Dec 2006 13:50:05 GMT
2006-12-22 <1166784884.365179.239100@xxxxxxxxxxxxxxxxxxxxxxxxxxx>,
jd wrote:
jd wrote:
jd wrote:
jd wrote:
Yahooooooooo wrote:
no gotos
no loops
how is it possbile.....
Asked in interview ...
Regards
MA#
recusion?
void foo(int a, b) {
if(a=b) then return
else {
printf("%d\n", a);
foo(a+1, b);
}
}
Whoops. Too hasty, == for equality, include stdio.h etc..
Bah! It gets worse! No 'then' obviously. Guess who has to program in
Delphi at the moment?
AAARRRGHH! And it only prints up to N-1 too. Should have been a>b.
I promise I'll never post again to clc.
You missed a semicolon </piling on>
.
- References:
- without loop printing 1 to n
- From: Yahooooooooo
- Re: without loop printing 1 to n
- From: jd
- Re: without loop printing 1 to n
- From: jd
- Re: without loop printing 1 to n
- From: jd
- Re: without loop printing 1 to n
- From: jd
- without loop printing 1 to n
- Prev by Date: Re: converting float to double
- Next by Date: Re: C-FAQ 19.7
- Previous by thread: Re: without loop printing 1 to n
- Next by thread: Re: without loop printing 1 to n
- Index(es):
Relevant Pages
|
|