Skip to content
TFE Times

TFE Times

Business, Technology, and Culture

Click here
MAFI_728x90
University of Maryland Masters of Economics Leaderboard
University of Maryland Masters of Economics  Leaderboard
MAFI_728x90
Click here
NYU Tandon School of Engineering Leaderboard
University of California Irvine Leaderboard
RPI Leaderboard
Click here
Brandeis University Master of Finance Leaderboard 728x90
University of California Irvine Leaderboard
  • Business
  • Culture
  • Technology
  • International Rankings
    • Bangladesh
    • Canada
    • Egypt
    • India
    • Nigeria
    • Pakistan
    • Philippines
    • United Kingdom
    • United States of America
  • Masters Rankings
    • Accounting
    • Business Analytics
    • Chiropractic
    • Computer Engineering
    • Computer Science
    • Economics
    • Education
    • Finance
    • Financial Economics
    • Financial Engineering
    • Law
    • Management
    • Marketing
    • MBA
    • Nursing
    • Social Work
  • Resources
    • C++
      • Beginner’s Guide to C++
      • An Introduction to the Imperative Part of C++
      • C++ Code
        • Sorts
        • Binary Search Trees
        • Strings
        • Binary Search
        • Math
        • Quant
        • Puzzles/Games
        • Language Concepts
        • Graphics
        • OS Operations
        • Graphs
      • C++ Full Course
      • C++ Crash Course
      • C++ Interview Questions
      • C++ Q/A
      • C++ Books
      • C++ Free Books
      • C++ Videos
    • C Questions
    • C Programming Tips
    • Java Questions
    • Quant Data Sources
    • Quant Questions

C++: Infinite Loops

Posted on September 1, 2017April 1, 2018 by TFE Times
Posted in C++Tagged c, infinite, infinite loop, loops
Bjarne-stroustrup
 


Specifically print out “SPAM” followed by a newline in an infinite loop.

while (true)
  std::cout << "SPAM" << std::endl;

or

for (;;)
  std::cout << "SPAM" << std::endl;

or

do
  std::cout << "SPAM" << std::endl;
while (true);

SOURCE

Content is available under GNU Free Documentation License 1.2.

Related

Post navigation

Bjarne-stroustrup
← Previous

C++: Exponentiation Operator

September 1, 2017
Bjarne-stroustrup
Next →

C++: Combinations

September 1, 2017

Related Posts

Bjarne-stroustrup

C++: Calculate Geometric Mean

Posted on September 1, 2017April 1, 2018
Bjarne-stroustrup

C++ Interview Question 3 Answer

Posted on April 16, 2015June 20, 2016
Bjarne-stroustrup

C++: Entropy

Posted on September 1, 2017April 1, 2018
output_8BgzjE
Brandeis Business School
Click here
NYU Tandon School of Engineering Sideboard
University of Maryland Masters of Economics Sideboard
University of Maryland Masters of Economics Sideboard
University of California Berkeley Master of Financial Engineering MFE Sideboard
University of California Irvine Leaderboard
  • Top 10 Restaurants in Seattle, Washington

    July 26, 2026June 20, 2026 by TFE Times
  • A Smarter Way to Enjoy Online Gaming in Malaysia

    July 25, 2026July 25, 2026 by TFE Times
  • Top 10 Restaurants in Nice, France

    July 25, 2026June 20, 2026 by TFE Times
  • 11 Top Idaho Vacation Rental Platforms for Your 2026 Getaway

    July 24, 2026 by TFE Times
  • The History of the 3-Wood: Golf’s Original Long-Range Utility Club

    July 24, 2026July 13, 2026 by TFE Times
  • Financial Tools That Make Big Life Decisions Easier

    July 23, 2026 by TFE Times
  • Red Wine vs White Wine: What’s the Difference?

    July 23, 2026July 13, 2026 by TFE Times
  • Top 10 Golf Courses in Kansas City

    July 22, 2026 by TFE Times
  • How an Employment Lawyer Helps Workers Fight Discrimination Cases

    July 22, 2026 by TFE Times
  • Purchasing Power Of The U.S. Dollar

    July 22, 2026December 30, 2025 by TFE Times

Copyright © TFE Times, LLC. All Rights Reserved.

Terms of Service | Privacy Policy | Disclaimer

WordPress Theme : Eight Paper by 8Degree Themes