Skip to content
TFE Times

TFE Times

Business, Technology, and Culture

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

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

C++: Lucas-Lehmer Test

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

C++: Single Inheritance

Posted on September 1, 2017April 1, 2018
University of California Irvine Leaderboard
output_8BgzjE
Click here
NYU Tandon School of Engineering Sideboard
University of Maryland Masters of Economics Sideboard
Brandeis Business School
University of California Berkeley Master of Financial Engineering MFE Sideboard
University of Maryland Masters of Economics Sideboard
  • OpenAI Stock Price Outlook and What Investors Should Know in 2026

    May 1, 2026 by TFE Times
  • America’s Wealth: U.S. Millionaires And Billionaires Vs. The Next Top 9 Countries

    May 1, 2026October 29, 2025 by TFE Times
  • U.S. Population Change Forecast 2025 To 2050

    April 30, 2026October 29, 2025 by TFE Times
  • Mercury In Fish

    April 29, 2026October 29, 2025 by TFE Times
  • Europe vs South America: who will win the 2026 World Cup?

    April 28, 2026 by TFE Times
  • How Tire Financing Options Make Replacements More Budget-Friendly

    April 28, 2026 by TFE Times
  • Optimizing Last-Mile Delivery With Smart Technology

    April 28, 2026April 28, 2026 by TFE Times
  • Crypto Careers featured

    The Future of Cryptocurrency in Bangladesh: Trends, Risks, and Possibilities

    April 28, 2026 by TFE Times
  • Annuity vs. lump sum: understanding lottery payout options

    April 28, 2026April 28, 2026 by TFE Times
  • Countries With The Most Years Lived In Poor Health

    April 28, 2026October 29, 2025 by TFE Times

Copyright © TFE Times, LLC. All Rights Reserved.

Terms of Service | Privacy Policy | Disclaimer

WordPress Theme : Eight Paper by 8Degree Themes