Skip to content
TFE Times

TFE Times

Business, Technology, and Culture

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

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


Start with a value at 0. Loop while value mod 6 is not equal to 0. Each time through the loop, add 1 to the value then print it. The loop must execute at least once.

int val = 0;
do{
   val++;
   cout << val << endl;
}while(val % 6 != 0);

SOURCE

Content is available under GNU Free Documentation License 1.2.

Related

Post navigation

Bjarne-stroustrup
← Previous

C++: Move-To-Front Algorithm

September 1, 2017
Bjarne-stroustrup
Next →

C++: Find the Last Sunday of Each Month

September 1, 2017

Related Posts

Bjarne-stroustrup

C++: Image Noise

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

C++: Function Prototype

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

C++: Iterated Digits Squaring

Posted on September 1, 2017April 1, 2018
Brandeis Business School
output_8BgzjE
University of California Irvine Leaderboard
Click here
NYU Tandon School of Engineering Sideboard
University of California Berkeley Master of Financial Engineering MFE Sideboard
  • Explore Signature Chicken Dishes That Define the Best Food Trucks

    November 19, 2025 by TFE Times
  • How Does Utah Law Protect You After a Dog Bite?

    November 19, 2025 by TFE Times
  • Why Digital Products Use Surprise Effects: The Psychology Behind User Interaction

    November 19, 2025 by TFE Times
  • Game Theory in Business: How Companies Compete by Mapping Hidden Strategic Patterns

    November 19, 2025November 19, 2025 by TFE Times
  • The Aesthetics of Neon and Night Lights: How “Nocturnal Luxury” Shapes Modern Tech Branding

    November 19, 2025 by TFE Times
  • Innovation as a Bet on the Future: Why Startups Survive on the Edge of Risk

    November 19, 2025 by TFE Times
  • “Random Rewards” and Gamification: How Tech Companies Use Surprise Mechanics to Keep Users Engaged

    November 19, 2025 by TFE Times
  • 25 AI Startups On The Rise

    November 19, 2025June 27, 2025 by TFE Times
  • The 50 Best Places To Work In America

    November 18, 2025June 27, 2025 by TFE Times
  • Turning Miles into Money: Expert Tips for Assessing Your Vehicle

    November 17, 2025 by TFE Times

Copyright © TFE Times, LLC. All Rights Reserved.

Terms of Service | Privacy Policy | Disclaimer

WordPress Theme : Eight Paper by 8Degree Themes