assignment1

assignment1 - Massachusetts Institute of Technology...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Massachusetts Institute of Technology Department of Electrical Engineering and Computer Science 6.087: Practical Programming in C IAP 2010 Problem Set 1 Solutions Writing, compiling, and debugging programs. Preprocessor macros. C Fle structure. Variables. ±unctions and program statements. Returning from functions. Out: Monday, January 11, 2010. Due: Tuesday, January 12, 2010. Problem 1.1 (a) What do curly braces denote in C? Why does it make sense to use curly braces to surround the body of a function? Answer: The curly braces denote a block of code, in which variables can be declared. Variables declared within the block are valid only until the end of the block, marked by the matching right curly brace ’}’ . The body of a function is one such type of block, and thus, curly braces are used to describe the extent of that block. (b) Describe the difference between the literal values 7 , "7" , and ’7’ . Answer: The Frst literal describes an integer of value 7. The second describes a null- terminated string consisting of the
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

Page1 / 3

assignment1 - Massachusetts Institute of Technology...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online