We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
  • HackerRank Home

    HackerRank

  • |
  • Prepare
  • Certify
  • Compete
  • Hiring developers?
  1. Prepare
  2. SQL
  3. Alternative Queries
  4. Print Prime Numbers

Print Prime Numbers

Problem
Submissions
Leaderboard
Discussions
  1. Prepare
  2. SQL
  3. Alternative Queries
  4. Print Prime Numbers
Exit Full Screen View
  • Problem
  • Submissions
  • Leaderboard
  • Discussions

Write a query to print all prime numbers less than or equal to . Print your result on a single line, and use the ampersand () character as your separator (instead of a space).

For example, the output for all prime numbers would be:

2&3&5&7
  • Blog
  • Scoring
  • Environment
  • FAQ
  • About Us
  • Support
  • Careers
  • Terms Of Service
  • Privacy Policy