Skip to content
TFE Times

TFE Times

Business, Technology, and Culture

Click here
Brandeis University Master of Finance Leaderboard 728x90
NYU Tandon School of Engineering Leaderboard
University of California Irvine Leaderboard
RPI Leaderboard
Click here
MAFI_728x90
Click here
University of California Irvine Leaderboard
MAFI_728x90
  • 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++: Mutex

September 1, 2017
Bjarne-stroustrup
Next →

C++: Combinations

September 1, 2017

Related Posts

Bjarne-stroustrup

C++: Matrix Exponentiation Operator

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

C++: Fibonacci Sequence

Posted on September 1, 2017April 1, 2018

C++ Interview Question 11 Answer

Posted on April 17, 2015June 20, 2016
University of California Irvine Leaderboard
output_8BgzjE
NYU Tandon School of Engineering Sideboard
University of California Berkeley Master of Financial Engineering MFE Sideboard
Brandeis Business School
Click here
  • Layoffs By US Industry

    October 10, 2025August 6, 2025 by TFE Times
  • The Income Needed To Buy A Home In 2025

    October 9, 2025May 25, 2025 by Patrick
  • AI Construction featured

    Why Hiring a Local Portland Plumber is Essential for Your Home Repairs

    October 8, 2025 by TFE Times
  • Crypto payment 101: a beginner’s guide for merchants

    October 8, 2025 by TFE Times
  • The Largest American University Endowments

    October 8, 2025May 25, 2025 by TFE Times
  • Traveling to Istanbul for a Hair Transplant: A Step-by-Step Guide for Patients

    October 7, 2025 by TFE Times
  • 1win: gamified bonuses & minimalist design for focused play

    October 7, 2025October 7, 2025 by TFE Times
  • 1win casino offers diverse games and a secure online gaming experience

    October 7, 2025 by TFE Times
  • The ROI of Relocation: How Moving Can Multiply Your Business Opportunities

    October 7, 2025 by TFE Times
  • Billion Dollar Companies By Country In 2025

    October 7, 2025May 25, 2025 by TFE Times

Copyright © TFE Times, LLC. All Rights Reserved.

Terms of Service | Privacy Policy | Disclaimer

WordPress Theme : Eight Paper by 8Degree Themes