Assign pizzasInStore's first element's numCalories with the value in pizzasInStore's second element's numCalories. #include #include typedef struct Pizza_struct { char pizzaName[75]; int numCalories; } Pizza; int main(void) { Pizza pizzasInStore[2]; scanf("%s", pizzasInStore[0].pizzaName); scanf("%d", &pizzasInStore[0].numCalories); scanf("%s", pizzasInStore[1].pizzaName); scanf("%d", &pizzasInStore[1].numCalories); /* Your code goes here */ printf("A %s slice contains %d calories.\n", pizzasInStore[0].pizzaName, pizzasInStore[0].numCalories); printf("A %s slice contains %d calories.\n", pizzasInStore[1].pizzaName, pizzasInStore[1].numCalories); return 0; } I tried 10 time but I cant solve it so please help me
Assign pizzasInStore's first element's numCalories with the value in pizzasInStore's second element's numCalories.
#include <stdio.h>
#include <string.h>
typedef struct Pizza_struct {
char pizzaName[75];
int numCalories;
} Pizza;
int main(void) {
Pizza pizzasInStore[2];
scanf("%s", pizzasInStore[0].pizzaName);
scanf("%d", &pizzasInStore[0].numCalories);
scanf("%s", pizzasInStore[1].pizzaName);
scanf("%d", &pizzasInStore[1].numCalories);
/* Your code goes here */
printf("A %s slice contains %d calories.\n", pizzasInStore[0].pizzaName, pizzasInStore[0].numCalories);
printf("A %s slice contains %d calories.\n", pizzasInStore[1].pizzaName, pizzasInStore[1].numCalories);
return 0;
}
I tried 10 time but I cant solve it so please help me
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 2 images