Department of Computer Science

Problem Solving and Algorithm Design I

Spring Semester 1998

Dr. Maury Eggen

Homework Laboratory Assignment 2:

1. Given the following C declarations, tell what would be stored in memory:
How many bytes are allocated for the variables in question?
1.1.
	int x;
	x = 55;

bytes: _______

memory: ______________


1.2. 
	int x;
	x = -55;

bytes: _______

memory: ______________

1.3.
	int x;
	x = 400; 

bytes: _______

memory: ______________

1.4.
	char y;
	y = 'A';

bytes: _______

memory: ______________


1.5. 
	char y;
	y = 'w';

bytes: _______

memory: ______________


1.6. 
	char y;
	y = ' ';

bytes: _______

memory: ______________


2. Assume that the declaration given resulted in the content as indicated.
What was the assignment?
2.1. 
	float x;
	x = ______________	resulted in 41500000 in memory.





2.2. 
	float x;
	x = ______________	resulted in C1500000 in memory.





2.3.
	float x;
	x = ______________ 	resulted in B3010000 in memory.


Homework Due Date: Monday, January 26, 1998