Got Homework?
Connect with other students for help. It's a free community.
Here's the question you clicked on:
 0 viewing
Rewrite the following set of program segment using for loop
int x, t = 0, s =0;
x=2;
do
{
s += x;
y=0;
do
{
t = t + s * y;
y++;
}while( y < x/2);
cout<<t<<s;
cout<<endl;
x+ +;
}while(x < 20 );
 one year ago
 one year ago
Rewrite the following set of program segment using for loop int x, t = 0, s =0; x=2; do { s += x; y=0; do { t = t + s * y; y++; }while( y < x/2); cout<<t<<s; cout<<endl; x+ +; }while(x < 20 );
 one year ago
 one year ago

This Question is Closed

ton12Best ResponseYou've already chosen the best response.0
@ajprincess @A.Avinash_Goutham
 one year ago

A.Avinash_GouthamBest ResponseYou've already chosen the best response.0
the first for is smthin like for(x=0;x<20;x++) and i think u shud work on the second
 one year ago

A.Avinash_GouthamBest ResponseYou've already chosen the best response.0
for(initialise ; bounds ; increment) any of those fields can be empty.... and when u have multiple initialisations u use a ' , ' and bound is a logical expression
 one year ago

pandabodohBest ResponseYou've already chosen the best response.1
int x, t = 0, s =0; x=2; for(x=0;x<20;) { s += x; y=0; for(y=0; y < x/2; y++;) { t = t + s * y; } cout<<t<<s; cout<<endl; x++; }
 one year ago

A.Avinash_GouthamBest ResponseYou've already chosen the best response.0
humph u r close @pandabodoh
 one year ago
See more questions >>>
Your question is ready. Sign up for free to start getting answers.
spraguer
(Moderator)
5
→ View Detailed Profile
is replying to Can someone tell me what button the professor is hitting...
23
 Teamwork 19 Teammate
 Problem Solving 19 Hero
 Engagement 19 Mad Hatter
 You have blocked this person.
 ✔ You're a fan Checking fan status...
Thanks for being so helpful in mathematics. If you are getting quality help, make sure you spread the word about OpenStudy.