Is this program write?
emptiness main
int times, count, s=0, av
cout<<"enter some sort of value";
pertaining to (i=0, i<100, i++)
cin>>x
s=s+x;
if(x==0)
exit (0)
depend ++;
in case (x==NILL)
count<<"NO AVERAGE";
av=s/count;
cout<<"Average is"<<av; endle
int times, count, s=0, av
what is going on there might be you designed this:
int times, count, vertisements, av=0;
also that you’re forgetting semicolons, you would like one soon after cin>>x and exit(0)
additionally here:
cout<<"Average is"<<av; endle
this should be
cout<<"Average is "<<av<<endl;
in fact it i NULL certainly not NILL.
hmm ok at the beginning I merely fixed your own syntax but the truth is have reasoning problems as well.
will not use exit(0); this may quit a person’s program along with its that’s doubtful what you deserve, I’m confused why a person; d use 0 but if you wish to stop having numbers should the user gets a 0 then instead use
bust;
also rather then if(x==NULL), make use of:if(x == 0), although WHEN I still dont comprehend the logic fot it, also put
av=s/count;
cout<<"Average is"<<av<<endl;
inside of an ALTOGETHER DIFFERENT statement:
in case (x==0)
count<<"NO AVERAGE";
else
av=s/count;
cout<<"Average is"<<av<<endl;
no; right after variable definitions, never explained i, really should be NULL certainly not NILL, plus cout << "Average is" << av << endl;
You composed it, then it must have got “write” the idea.
Leave a Reply
You must be logged in to post a comment.