#define _CRT_SECURE_NO_WARNINGS #include typedef struct { char brand[30]; int horsePower; char color[15]; char bodyType[30]; }car; int main(void) { car car1 = { "Dodge",707,"Black","Coupe" }; car* car1Ptr = &car1; printf("The car information is:\n"); printf("Brand: %s\n", car1.brand); printf("Horse Power: %d\n", car1.horsePower); printf("Color: %s\n", car1.color); printf("Body Type: %s", car1.bodyType); } #define _CRT_SECURE_NO_WARNINGS #include #include void readList(int* array, int howManyNum) { int num; printf("Enter list elements:\n"); for (int i = 0; i < howManyNum; i++) { scanf("%d", &num); *(array + i) = num; } } void findSumPro(int* array, int howManyNum, int* sum, int* product) { *sum = 0; *product = 1; for (int i = 0; i < howManyNum; i++) { *sum += *(array + i); *product *= *(array + i); } } int compareSumPro(int* array, int howManyNum) { int sum = 0, product = 1; findSumPro(array, howManyNum, &sum, &product); if (sum > product) { return 1; } else if (sum < product) { return 2; } return 0; } int main(void) { int* array; int howManyNum; printf("Enter the number of values you want to input:"); scanf("%d", &howManyNum); array = (int*)malloc(sizeof(int) * howManyNum); readList(array, howManyNum); int result = compareSumPro(array, howManyNum); switch (result) { case 0: printf("The sum of the elements is EQUAL to the product of the elements!"); break; case 1: printf("The sum of the elements is GREATER than the product of the elements!"); break; case 2: printf("The sum of the elements is LESS than the product of the elements!"); } }