Advertisement
kalin729

from 1 to n % k c++

Jun 14th, 2018
183
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. int n,k;
  6. cout << "n: ";
  7. cin >> n;
  8. cout << "k: ";
  9. cin >> k;
  10.  
  11. for(int i = 0; i<n; i++){
  12.     if(i%k==0){
  13.         cout << i << endl;
  14.     }
  15. }
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement