1.
Show the output of the following program.
// function prototypes
void Prob1();
void Prob2();
// definitions
void main()
{
// open text and drawing windows
TinySquarePair();
// do the work here
Prob1();
cout << endl;
Prob2();
cout << endl;
}
void Prob1(){
int x = 1;
int y = 1;
while (x < 100){
cout << y << " " << x << endl;
x = 2*x + y;
y++;
}
}
void Prob2(){
int D = 1;
int M;
for (M = 0; M < 2000; M = 2*M + D){
cout << M << " " << D << endl;
D = 10*D;
}
}
2.
Write a for loop that writes out a list of all the positive, integral powers of 2 that are less than 1000.
3. Write a function Poly that inputs an argument double x and returns the value of
Last Updated: October 11, 1997 12:36 pm by