Re: Hey guys little prob
- From: "mazsx" <borsanyi@xxxxxxxxxxxxxxxxxxxxxxxx>
- Date: 14 Nov 2005 11:14:21 -0800
> I want to know why the program is printing the numbers twice on the screen.
Strange question...
> #include<stdio.h>
> int main()
> {
> float n[100]={10,20,30,40,50,60,70,80,90,100}, sum=0.0;
> int i;
>
>
> for(i=0; sum<=100.0; i++)
> {
> sum=sum+n[i];
>
> if (sum<=100.0)
> {printf("%.1f \n", n[i]);}
> else
> n[i]=-1;
> {printf("%.1f \n", n[i]);}
^^^^^^^^^^^^^^^^^^^
Have you thought of this line?
mazsx
.
- Prev by Date: Re: How to count bits in a unsigned int?
- Next by Date: Re: C99 VLAs (was Re: Stack or Heap)
- Previous by thread: Stack or Heap
- Next by thread: Casting function pointers
- Index(es):
Relevant Pages
|