How would I translate this loop into a while loop
int power2 = 1;
for (int i=0; i%26lt;n; i++) {
power2 *= power2;
}
cout %26lt;%26lt; power2;
Translate this switch statement into equivalent if or if / else statements.
switch (xx) {
case 1: cout %26lt;%26lt; "Hello";
break;
case 3: cout %26lt;%26lt; "Goodbye";
break;
default: cout %26lt;%26lt; "Never mind.";
}
If you don't know please don't answer; Thanks!
Translating loops in C++?
int i=0;
while (i %26lt;n)
{
power2 *=power2;
i++;
}
cout %26lt;%26lt; power2;
if (xx == 1)
cout %26lt;%26lt; "hello";
else if(xx ==3)
cout %26lt;%26lt; "Goodbye";
else
cout %26lt;%26lt; "Never mind";
Reply:you get help from http://tutorialofc.blogspot.com/
sweet pea
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment