how do you write a c++program using the do while and while do loop to list prime numbers between one and thirty
A. Gregory
0
Newbie Poster
Recommended Answers
Jump to Post#include <iostream> int main() { do { std:: cout << "2,3,5,7,11,13,17,19,23,29" std::endl; } while (false); }
Jump to Postthe condition will always evaluate to false.
Gosh, will it really?
Jump to Post@rubberman According to the standard 3.6.1.5 main has an implicit
return 0;
if one is not providedA return statement in main has the effect of leaving the main function (destroying any objects with automatic storage duration) and calling std::exit with the return value as the argument. If control …
All 12 Replies
Moschops
683
Practically a Master Poster
Featured Poster
rubberman
1,355
Nearly a Posting Virtuoso
Featured Poster
Moschops
683
Practically a Master Poster
Featured Poster
rubberman
commented:
From the department of sarcasm department? :-)
+13
NathanOliver
429
Veteran Poster
Featured Poster
rubberman
1,355
Nearly a Posting Virtuoso
Featured Poster
deceptikon
1,790
Code Sniper
Team Colleague
Featured Poster
rubberman
1,355
Nearly a Posting Virtuoso
Featured Poster
David W
131
Practically a Posting Shark
rubberman
1,355
Nearly a Posting Virtuoso
Featured Poster
David W
131
Practically a Posting Shark
deceptikon
1,790
Code Sniper
Team Colleague
Featured Poster
David W
131
Practically a Posting Shark
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.