#include <iostream> #include <cstdarg> using namespace std; int a; double num1; int isGeometric (int a, double num1 ...); void main() { cout << "Geometric Sequence" << endl; cout << "Enter a number to be used as a common ratio." << endl; cin >> a; if (a <= 0) { cout << "Please enter a positive number." << endl; cin >> a; } else a = a; cout << "Enter a number to start calculating the geometric sequence." << endl; cin >> num1; if (num1 <= 0) { cout << "Please enter a positive number." << endl; cin >> a; } else num1 = num1; cout << "The geometric sequence with the common ratio you entered, " << a << ", starting at " << num1 << " is: \t" << isGeometric << endl; } int isGeometric (int a, double num1 ...) { va_list arguments; double num = num1, total = num; va_start(arguments, num1); do { total = a * num; cout << num << " "; } while( (num = va_arg(arguments, double) ) != 0); va_end(arguments); return total; }

Feedback is appreciated, my assignment is due next week too just to throw that in there. Thanks!