fork download
  1. #include <iostream>
  2.  
  3. int main()
  4. {
  5. std::cout << "Enter the natural number ";
  6. int m;
  7.  
  8. if (!(std::cin >> m)) {
  9. std::cout << "Invalid entry\n";
  10. } else {
  11. for (int i = 1; i < m; i++) {
  12. for (int j = 4; j < i; j++) {
  13. int rem = i + j;
  14. std::cout << rem << '\n';
  15. }
  16. }
  17. }
  18. }
  19.  
Success #stdin #stdout 0s 3100KB
stdin
4
stdout
Enter the natural number