the general purpose is to enter 3 variables and manipulate them the problem is that the program compiles with 0 errors but crashes when i enter a variable.
i get an aplication error (pop up box with the red X)
error:
Quote:
the instruction at "0x004021b8" references memory at 0x006e0065". The memory could not be "written".
click on ok to terminate the program
click cancel to debug the program.
|
code of the program
Quote:
#include <stdio.h>
main(void)
{
int nRoomLength=0, nRoomWidth=0, nRoomHeight=0;
double dWidthToLength=0 ; /* width/length */
short int nRoomVolume=0 ; /* nRoomWidth * nRoomLength * nRoomHeight*/
unsigned int nRoomArea=0 ; /* nRoomWidth * nRoomLength */
printf("Please enter a value for the room width:");
scanf("%d, &nRoomLength");
printf("Please enter a value for the room length::");
scanf("%d, &nRoomWidth");
printf("Please enter a value for the room height::");
scanf("%d, &nRoomHeight");
dWidthToLength = nRoomWidth / nRoomLength;
nRoomArea = nRoomLength * nRoomWidth;
nRoomVolume = nRoomLength * nRoomWidth * nRoomHeight;
printf("The area of the floor of the room is: %d, nRoomArea");
printf("The volume of the room is: %d, nRoomVolume");
printf("The ratio of the width to the length is: %d, dWidthToLength");
}
|