Ask
your own question, for FREE!
Computer Science
16 Online
this is my program,what's the problem?int main() {int a,b,s,n; float q; cin>>b; s=0; while(s
Still Need Help?
Join the QuestionCove community and study together with friends!
What language is this
I'm working on visual C++
at first glance, it looks correct. What is it doing wrong?
oh wait, you're using n in the loop, but it wasn't initialized.
you just need one loop. initialize n to 1, and in the while loop, add 1/n to s, then increase n by 1.
Still Need Help?
Join the QuestionCove community and study together with friends!
s=s+q; would demote q from a float to an int, also.
yes, that too :-)
s should be a float or double.
Can't find your answer?
Make a FREE account and ask your own questions, OR help others and earn volunteer hours!
Join our real-time social learning platform and learn together with your friends!
Join our real-time social learning platform and learn together with your friends!
Latest Questions
JohnnyLFowler0812:
What type of gamer would play something and then get off for a while. Why not sta
JohnnyLFowler0812:
Which is better? Metallica Rap Country R&B hiphop Medal Gospel Chill Which 3 opti
playtsec:
how do I sleep without getting a sore throat? I always wake up with a sore throat but it goes away later in the day.
75:
how do you react when you deal with someone who plays the victim in every single situation, and do you find this behavior childish or annoying.
JohnnyLFowler0812:
Do you guys ever think that the homeless are going to be healthy and freed from h
JohnnyLFowler0812:
Do you guys ever think that Hikaru Nikanura will ever be take Magnus Calrsen's 1st place title in the wolrdin the United States amd Norway? Right now Hikaru
DoltonCarlee:
what are y'all's options on S A T essays because honestly their not that bad
thereneelg:
Can someone give me a summary of article 231, The war guilt clause?? I need to explain what it is, but I can't find any shortened version of what it is and
15 minutes ago
0 Replies
0 Medals
21 minutes ago
0 Replies
0 Medals
7 hours ago
9 Replies
2 Medals
5 hours ago
3 Replies
0 Medals
13 hours ago
7 Replies
1 Medal
17 hours ago
2 Replies
0 Medals
1 hour ago
8 Replies
2 Medals
3 days ago
7 Replies
1 Medal