It displays [Error] invalid operands to binary + (have 'struct bus' and 'struct bus') enter code here
struct bus
{int bus;
}b1,b2,b3;
int main()
{
printf("Enter bus fair 1");
scanf("%d", &b1.bus);
printf("Enter bus fair 2");
scanf("%d", &b2.bus);
printf("Enter bus fair 3");
scanf("%d", &b3.bus);
expenses = b1+b2+b3; 5*14*2 ;
printf("Travelling expense is; %d", expenses);
return 0;}
Did small changes, don't have much knowledge on this yet obviously.code image
Edit- It worked after changing the error line as this, but still I want to know why it didn't work in the previous code.
enter code here
expenses = (b1.bus+b2.bus+b3.bus) ;5*14*2 ;