C++ program :-
#include <iostream>
using namespace std;
int writeLine(char ch, int
num)
{
if(num==0)
return 0;
printf("%c",ch);
return writeLine(ch,num-1);
}
void writeBlock(char ch, int
char_count, int line_count)
{
for(int i=0;i<line_count;i++)
{
writeLine(ch,char_count);
printf("\n");
}
}
int main() {
writeBlock('*',5,3);
}
Output :-
Get Answers For Free
Most questions answered within 1 hours.