Re: writing 6 items in one line.
Marcel <[email protected]>
| Newsgroups | gmane.comp.programming.cppug |
|---|---|
| Message-ID | <[email protected]> |
I guess you could write a module that prints instead
of making a call to printf()
something like
print(float f)
{
float buffer[6];
// insert f int the buffer
// if buffer is full makes 6 calls to printf and
// empty buffer
// printf("\n")
}
marcel
--- Ronen Kfir <[email protected]> wrote:
> Hi,
> I have this code:
>
>
> #include <stdio.h>
> void main()
> {
> int i,n=40;
> float a=0,b=1;
> for (i=1;i<=n;i++)
> {
> printf("%.0f\n",a);
> printf("%.0f\n",b);
> a+=b;
> b+=a;
> }
>
> getch();
> }
>
> It present Fibonacci serial of 40 elements. Now I
> need to divide it to
> groups of 6 in each row.
>
> Please help me do it.
>
> Cheers.
>
>
>
> R o n e n K f i r
> System Administrator
> CIT div. Tel Aviv University
> Israel
> Tel: 972-3-6407416
> Fax: 972-3-6405158
> cellular: 972-55-405910
> E-mail: [email protected]
>
>
>
>
>
>
> ------------------------ Yahoo! Groups Sponsor
>
>
> Yahoo! Groups Links
>
>
> [email protected]
>
>
>
__________________________________
Do you Yahoo!?
Yahoo! Photos: High-quality 4x6 digital prints for 25¢
http://photos.yahoo.com/ph/print_splash
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/cppug/
<*> To unsubscribe from this group, send an email to:
[email protected]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/