Generation

generate functionWed, 22 Feb 2023

Write a C++ recursive function to print following pattern. No loops allowed whatsoever, and you can write other helping (recursive) functions. Your function prototype must be as follows: void PrintPattern1(int start, int end);

void PrintPattern1(int start, int end) { if(start > end) { return; } cout<<start<<" "; PrintPattern1(start+5, end); cout<<start<<" "; }

Questions about programming?Chat with your personal AI assistant