for loop help(math aspect)

See after code

#include <iostream>
using namespace std;
int main ()
{
int a;
for ( a=1; a<101; a=a+1)
{
cout<<"List 0-100: "<<a<<endl;
}
int b;
for (b=21; b<=35; b=b+1)
{
cout<<" "<<b;
cout<<endl;
}
int c;
for (c=35; c>=1.0; c=c-1.0)
{
cout<<"35 counting backwards to 1: "<<c<<endl;
}
int d;
for ()
{
cout<<" Squares of the first 20 positive integers"<<d<<endl;
}



return 0;
}

4."Display the square roots of the first 20 positive integers in increasing order."
I have no clue how make this work, the assignment is generally listing numbers using for loops. I have completed several listing number functions already, but do not know how to solve this one. I would like to use what I have and modify the previous for loop as seen above. Also, how would I print b on just one line then end it. It seems when I run it that it goes into the next line.
5. Input a value for x from the keyboard. Display the value of x and decrease x by 0.5 as long as x is positive. As above, need help with the math aspect of it.
Thank you :) also first time on the forum..


Last edited on
Topic archived. No new replies allowed.