belongs to collection: Loop Programs In C ++Programming
Write A Program To Print A Message Multiple TimesLogic :-
Enter your MSG and Run any loop ,this is your choice how many time's you want to print a MSG
#include<iostream> using namespace std; int main() { int n,i; string str; cout<<"Enter The MSG :\n"; cin>>str; cout<<"Enter How Many Times You Want To Print MSG : \n"; cin>>n; for(i=0 ;i<n ;i++) { cout<<str<<endl; } cout<<endl; return 0; }
Output:
Enter The MSG :
mohamad
Enter How Many Times You Want To Print MSG :
8
total answers (1)
start bookmarking useful questions and collections and save it into your own study-lists, login now to start creating your own collections.
Output:
Enter The MSG :
mohamad
Enter How Many Times You Want To Print MSG :
8
mohamad
mohamad
mohamad
mohamad
mohamad
mohamad
mohamad
mohamad
need an explanation for this answer? contact us directly to get an explanation for this answer