// Pantea Aria // Command line arguments example // write a program that calculates the total number of steps walked over several days. // Each command line argument represents the number of steps for one day. // Your program should: // Read the step counts from the command line // Convert each value from a string to an integer // Calculate the total number of steps // Print the final total #include #include int main(int argc, char *argv[]) { int i = 1; int sum = 0; while (i < argc) { sum = sum + atoi(argv[i]); i++; } printf ("Total steps is %d\n", sum); return 0; }