int main() {
char instring[81]; int pos=0;
//read in a string of characters
cout << "Enter a string of characters." << endl;
cin.getline(instring, 80);
while (instring[pos] != 0) pos++;
cout << pos << endl;
return 0;
}//end main
int main() {
float base; int power; float result=1; int i;
cout << "Enter base: "; cin >> base;
cout << "Enter power: "; cin >> power;
//insert a for loop below to compute result = base raised to the power
cout << "result = " << result << endl;
return 0;
}//end main
|
A) 12 B) 22 C) 10 D) 7 E) nothing - the while loop will never end. |