CSCI 159 Quiz 2 | Name: |
gedit quest1.cpp &
g++ quest1.cpp -o quest1x
./quest1x
There are three questions and you have 60 minutes to complete the quiz.
for (x = 17; x > 0; x = x - 3) {
cout << "Current value " << x << ", squared is " << (x*x) << endl;
}
|
float foo(float f)
{
float R = 1.5;
if (f > R) {
cout << f << endl;
return(foo(f - R));
}
return f;
}