//CSC099 Individual Assignment //Name : MUHAMMAD IRFAN TIJANIE BIN MOHAMMAD TASNIM //STUDENT ID : 2019273078 //GROUP : PI009E34 #include void realgas(float,int); void display(int,float); #define a 3.592 //co2 van der walls constant #define b 0.0427 #define r 0.08206 //gas constant int main() //main fn { float mole; int temp; char choice; do { do{ printf("Mole: "); scanf("%f", &mole); if(mole<=0) //reenter if mole<=0 printf("Invalid Input . Please enter Positive value\n\n"); } while(mole<=0); do{ printf("Temperature (Kelvin): "); scanf("%d", &temp); if(temp<=0) //reenter if temperature<=0 printf("Invalid Input . Please enter Positive value\n\n"); } while(temp<=0); realgas(mole, temp); do{ printf("\n\n\nDo you want to continue (Y,y-Yes, N,n-NO): "); scanf(" %c", &choice); if(choice!='Y'&&choice!='y'&&choice!='N'&&choice!='n') //reenter if invalid input printf("Invalid Input. Please enter Y,y or N,n\n"); } while(choice!='Y'&&choice!='y'&&choice!='N'&&choice!='n'); printf("-------------------------------------------------------------\n"); } while(choice=='Y'||choice=='y'); printf("From this calculation, you know that when volume (ml) in increasing,\npressure of gas reduce\n\nThank you"); } void realgas(float mole, int temp) //calculation fn { int i_vol,f_vol,inc,dec; float ps; do{ //repeat if negative printf("Initial volume (milliliter): "); scanf("%d", &i_vol); if(i_vol<=0) //display error printf("Invalid Input . Please enter Positive value\n\n"); } while(i_vol<=0); do{ //repeat if negative printf("Final volume(): "); scanf("%d", &f_vol); if(f_vol<=0) //display error printf("Invalid Input . Please enter Positive value\n\n"); } while(f_vol<=0); if(i_vol