Answer to Question #206938 in C++ for kyle

Question #206938

Programming challenge/seatwork. Modify the program using the discussed sample program that will give the following output and use a function with parameter and no return type.


Use this to view the picture:

https://drive.google.com/file/d/1EG50edwQCKgXSWM8adkhe08w9gAWw2Sp/view?usp=sharing


1
Expert's answer
2021-06-14T12:19:21-0400
Using function:


#include<iostream>
#include<string>


using namespace std;


void print(int number);


int main(){
	int number=-1;


	while(number<1 || number>10){
		cout<<"Entre a number less than 10 ";
		cin>>number;
	}


	print(number);
	cin>>number;
	return 0; 
}


// output and use a function with parameter and no return type.
void print(int number){
	cout<<"\n";
	char character='a';
	for(int i=1;i<=number;i++){
		for(int j=0;j<i;j++){
			cout<<character;
			character++;
		}
		cout<<"\n";
	}

}



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
New on Blog