Wheemangga

[C++] Loop Increment Bilangan Prima

Nov 17th, 2020
822
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.20 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6.     int x;              // Deklarasi Variabel
  7.    
  8.     for (x = 1; x <=10; x+=2)   // Kondisi Loop
  9.     {
  10.         cout << x << ", ";
  11.     }
  12. }
  13. // Output '3, 5, 7, 9,'
Advertisement
Add Comment
Please, Sign In to add comment