Answer to Question #16054 in C++ for mark

Question #16054
how do i create a c++ program that will diplay my name three times using a while loop. Thanks
1
Expert's answer
2012-10-11T08:31:37-0400
#include <iostream>
using namespace std;

int main() {
char name[30];
cout << "Enter your name: ";
cin >> name;
cout << endl;
int k = 0;
while (k < 3) {
& cout << name << endl;
& k++;
}
return 0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
APPROVED BY CLIENTS