Difference between revisions of "CPP/Loops/While"

From ProgrammingExamples
< CPP
Jump to: navigation, search
(Undo revision 4928 by Daviddoria (Talk))
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
ios that american ?, http://ensignro.frantech.ca/forum/index.php?showtopic=1160 tramadol sales, 847798, http://www.ericferguson.ca/phpBB3/viewtopic.php?f=2&t=229252 purchase tramadol canada, 9994,
+
<source lang="cpp">
 +
#include <iostream>
 +
using namespace std;
 +
   
 +
int main(){
 +
 +
const int END = 0;
 +
int input = -1;
 +
   
 +
while(input != END){
 +
  cin >> input;
 +
  cout << input * 2 << endl;
 +
}
 +
 +
return 0;
 +
}
 +
</source>

Latest revision as of 11:12, 20 September 2011

#include <iostream>
using namespace std;
 
int main(){
 
 const int END = 0;
 int input = -1;
 
 while(input != END){
   cin >> input;
   cout << input * 2 << endl;
 }
 
 return 0;
}