Increasing sequence with given GCD | C ++ implementation of the approach ; Function to print the required sequence ; Driver Code
#include <bits/stdc++.h> NEW_LINE using namespace std ; void generateSequence ( int n , int g ) { for ( int i = 1 ; i <= n ; i ++ ) cout << i * g << " ▁ " ; } int main ( ) { int n = 6 , g = 5 ; generateSequence ( n , g ) ; return 0 ; }