Skip to content
TFE Times

TFE Times

Business, Technology, and Culture

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

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

C++: Concurrent Computing

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

C++ Interview Question 1 Answer

Posted on April 16, 2015June 20, 2016
NYU Tandon School of Engineering Sideboard
University of California Berkeley Master of Financial Engineering MFE Sideboard
output_8BgzjE
University of Maryland Masters of Economics Sideboard
Click here
Brandeis Business School
University of Maryland Masters of Economics Sideboard
University of California Irvine Leaderboard
  • Top 10 Restaurants in Charlotte, North Carolina

    September 6, 2026June 20, 2026 by TFE Times
  • Top 10 Restaurants in Reykjavik, Iceland

    September 5, 2026June 20, 2026 by TFE Times
  • The History of the Pitching Wedge: How Golf’s Scoring Club Lost Its Loft

    September 4, 2026July 13, 2026 by TFE Times
  • 7 Common Mistakes to Avoid When Selecting a Digital Quality Solution

    September 3, 2026 by TFE Times
  • Best White Wines for Beginners

    September 3, 2026July 13, 2026 by TFE Times
  •  How to Recover an Exchange Database from “Dirty Shutdown” State?

    September 2, 2026 by TFE Times
  • The World’s Most Spoken Languages

    September 2, 2026December 30, 2025 by TFE Times
  • Signs You Need to Upgrade Your Loan Origination System

    September 1, 2026September 2, 2026 by TFE Times
  • Minerals, Gems and Precious Stones

    September 1, 2026December 30, 2025 by TFE Times
  • AI-Generated Microdramas Are Displacing Human Casts Across China’s Short-Video Industry

    August 31, 2026 by TFE Times

Copyright © TFE Times, LLC. All Rights Reserved.

Terms of Service | Privacy Policy | Disclaimer

WordPress Theme : Eight Paper by 8Degree Themes