ValerianBenchea

Produsul primelor n numere pare

Nov 21st, 2019
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.22 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.     int n, x, i;
  8.     cout<<"n="; cin>>n;
  9.     x=0;
  10.     i=1;
  11.     while(i<=n)
  12.     {
  13.         cout<<x<<" ";
  14.         x=x+2;
  15.         i=i+1;
  16.     }
  17.     return 0;
  18. }
Add Comment
Please, Sign In to add comment