Skip to content
TFE Times

TFE Times

Business, Technology, and Culture

NYU Tandon School of Engineering Leaderboard
University of Maryland Masters of Economics Leaderboard
Click here
MAFI_728x90
Click here
University of California Irvine Leaderboard
Click here
University of Maryland Masters of Economics  Leaderboard
MAFI_728x90
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++: 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++: Continuous Knapsack Problem

September 1, 2017
Bjarne-stroustrup
Next →

C++: Find the Last Sunday of Each Month

September 1, 2017

Related Posts

Bjarne-stroustrup

C++: Complex Number Arithmetic

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

C++: Break OO Privacy

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

C++: Forest Fire

Posted on September 1, 2017April 1, 2018
Brandeis Business School
University of California Berkeley Master of Financial Engineering MFE Sideboard
University of Maryland Masters of Economics Sideboard
Click here
NYU Tandon School of Engineering Sideboard
University of California Irvine Leaderboard
University of Maryland Masters of Economics Sideboard
  • The Global Cost Of Violence

    July 1, 2026November 28, 2025 by TFE Times
  • The Future of Short-Term Lending: How Fintech Is Reshaping Access to Funds

    June 30, 2026 by TFE Times
  • Leading Causes Of Death In The U.S.

    June 30, 2026November 28, 2025 by TFE Times
  • Most Anticipated CS2 Tournaments in the Second Half of 2026

    June 29, 2026 by TFE Times
  • Who Drinks The Most Coffee?

    June 29, 2026November 28, 2025 by TFE Times
  • Top 10 Restaurants in San Antonio, Texas

    June 28, 2026June 20, 2026 by TFE Times
  • Top 10 Restaurants in Florence, Italy

    June 27, 2026June 20, 2026 by TFE Times
  • What Employees Should Know After A Workplace Injury

    June 26, 2026 by TFE Times
  • Countries Where Money Loses Value The Fastest

    June 26, 2026November 28, 2025 by TFE Times
  • 5 Leading Wholesale Towel Suppliers for Bulk Purchases

    June 25, 2026 by TFE Times

Copyright © TFE Times, LLC. All Rights Reserved.

Terms of Service | Privacy Policy | Disclaimer

WordPress Theme : Eight Paper by 8Degree Themes