Advertisement
HakdogForce

Untitled

Oct 29th, 2018
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main(){
  5.  
  6. int x, a;
  7.  
  8. cout << "Enter a number from 1 to 10: ";
  9. cin >> x;
  10. cout << "\n";
  11. for(int i = 1; i <= 10; i++){
  12. if (i == x){
  13. cout << "Dong";
  14. continue;
  15. }
  16. cout << "Ding";
  17. }
  18.  
  19. cout << "\n\nEnter another? [1] YES [2] NO: ";
  20. cin >> a;
  21.  
  22. if(a == 1){
  23. system("cls");
  24. cout << "\n";s
  25. return main();
  26. }
  27. if(a == 2 || a > 2){
  28. system("pause");
  29.  
  30. }
  31. cout << "Program Ends, Happy Programming!!!";
  32. return 0;
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement