Answer to Question #54259 in C++ for Ric

Question #54259
Write a program that will display the following pattern, given the value of n and m. Example : if n=4, and m=3, output. **** **** ****
Expert's answer
#include <iostream>
using namespace std;
int main(){
int n,m;
cout<<"Please input n = ";
cin>>n;
cout<<"Please input m = ";
cin>>m;
int j=1;
do{
for(int i=1;i<=n;i++)
{
cout<<"*";
if (i%n==0) cout<<endl;
}
j++;
}while(j<=m);
}

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 first!

Leave a comment

Ask Your question

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS
paypal