Advertisement
laith-0093

C++

Jan 16th, 2020
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. #include <iostream.h>
  2. #include <conio.h>
  3. void T(char ,int);
  4. void main ()
  5. {
  6. char L;
  7. int M;
  8. L: cout << "\nEnter a character: ";
  9. cin >> L;
  10. cout << "Enter number of times to repeat it: " ;
  11. cin >> M;
  12. T(L,M);
  13. goto L;
  14. getch();
  15. }
  16. void T(char ch, int n)
  17. {
  18. for (int j = 0; j < n; j++)
  19. cout << ch ;
  20. cout << endl;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement