Create a C program that reads from a SQLite database, selects all rows from a given table, and prints the results to the console. The user should provide the database file path and table name via command line arguments.

```c
#include <stdio.h>
#include <stdlib.h>
#include <sqlite3.h>

static int callback(void *NotUsed, int argc, char **argv, char **azColName) {
    for (int i = 0; i < argc; i++) {
        printf("%s = %s\n", azColName[i], argv[i] ? argv[i] : "NULL");
    }
    printf("\n");
    return 0;
}

int main(int argc, char *argv[]) {
    sqlite3 *db;
    char *zErrMsg = 0;
    int rc;

    if (argc != 3) {
        fprintf(stderr, "Usage: %s DATABASE TABLE\n", argv[0]);
        return 1;
    }

    rc = sqlite3_open(argv[1], &db);
    if (rc) {
        fprintf(stderr, "Can't open database: %s\n", sqlite3_errmsg(db));
        sqlite3_close(db);
        return 1;
    }

    char sql[100];
    snprintf(sql, sizeof(sql), "SELECT * FROM %s;", argv[2]);

    rc = sqlite3_exec(db, sql, callback, 0, &zErrMsg);
    if (rc != SQLITE_OK) {
        fprintf(stderr, "SQL error: %s\n", zErrMsg);
        sqlite3_free(zErrMsg);
    } else {
        fprintf(stdout, "Operation done successfully\n");
    }

    sqlite3_close(db);
    return 0;
}
```

To compile and run the program:

1. Save the code in a file named `read_sqlite.c`.
2. Install SQLite development package if not already installed.
   - For Ubuntu/Debian: `sudo apt-get install libsqlite3-dev`
   - For CentOS/Fedora: `sudo yum install sqlite-devel`
3. Compile the program using the following command: `gcc read_sqlite.c -o read_sqlite -lsqlite3`
4. Run the program with the required arguments, for example: `./read_sqlite test.db mytable`