How to take input "n" and print y ,"n" times in c++ | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

How to take input "n" and print y ,"n" times in c++

19th Jan 2022, 8:30 AM
RAJ VIKRAM
RAJ VIKRAM - avatar
4 Answers
+ 1
RAJ VIKRAM As you progress through your course, you will be introduced to the "for loop" which is what you need to resolve your problem. Keep learning and you can answer this yoirself
19th Jan 2022, 9:50 AM
Rik Wittkopp
Rik Wittkopp - avatar
+ 1
Thank you☺️☺️
19th Jan 2022, 10:09 AM
RAJ VIKRAM
RAJ VIKRAM - avatar
+ 1
#include<iostream> using namespace std; int main(){ int n; cin<<n; for(int i=0;i<n;i++){ cout<<"y"; } return 0; }
20th Jan 2022, 6:18 PM
Rakshya Thapa