#include <stdio.h> #include <string.h>
int main(void) { int num, num2; printf("Please input one number:\n"); scanf("%d", &num); printf("Please input another number:\n"); scanf("%d", &num2); int num3 = num * num2 + 8 * num;
char sql[150]; memset(sql, '\0', sizeof(sql)); sprintf(sql, "INSERT INTO Numbers VALUES (NULL, %d, %d, 'STR%d')", num, num2, num3); printf("%s;\n", sql); return 0; }
|