Define a function AdjustState() that takes one integer parameteras the water temperature and one character parameter passed bypointer as the water's state ('L' means liquid, 'B' means boiling,and 'G' means gas). The function updates the state with:
Ex: If the input is 104, then the output is:
Water state is changed to G.
#include <stdio.h>#include <stdbool.h>/* Your code goes here */
int main(void) { int waterTemperature; char waterState; bool isChanged;
waterState = 'B'; scanf("%d", &waterTemperature);
isChanged = AdjustState(waterTemperature,&waterState);
if (isChanged) { printf("Water state is changed to %c.\n",waterState); } else { printf("Water state %c is not changed.\n",waterState); }
return 0;}
in c please
Define a function AdjustState() that takes one integer parameter as the water temperature and one character parameter pa
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am