#include "stdio.h" #include #include "math.h" using namespace std; int main ( int argc, char** argv ) { double a, b; //previously was int then float as examples double c; c = atof(argv[1]); cout << c << endl; //cout << "Give me 2 numbers: "; fprintf(stdout,"Give me 2 numbers: "); //cin >> a >> b; scanf("%lf %lf", &a, &b); if ( a < 0 ) { fprintf(stderr,"I don't like your numbers!\n"); } else if ( a == 0 ) { cout << "Argh, zero!!" << endl; } else { cout << "You are awesome!" << endl; } //cout << "Their sum is = " << pow(a,b) << endl; printf("%f %f %f\n",sqrt(a),exp(b),log10(a*b)); //Next time: functions, switch, file reading & writing, strings, arrays return 0; }