[#JARQ] Hey Community!! | Sololearn: Learn to code for FREE!

+4

[#JARQ] Hey Community!!

Is There Any Similar Function Or Way To Print Some Character Multiple Times In C++ Just Like We Do In Python EX:->>>> print(5*'&') Output----------&&&&& Just Any Method Of Doing That In A Short And Simpler Way. Thanks For Your Time...😊😊

4/25/2018 6:14:31 PM

™TheChamp921

4 Answers

New Answer

+4

I think this will work: cout << string(5, '&');

+4

yup, Zeke Williams, it works---just tested it in playground.

+3

Eric Zatarack nice 😎

+3

Thanks @Zeke This Is Really Going To Help A Lot Cheers Bud!!✋