3_Answers_2-1 - CIS 15AG 1 Answers Chapter 2: Introduction...

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

View Full Document Right Arrow Icon
CIS 15AG Answers Chapter 2: Introduction to the C Language 1. What is the type of each of the following literal constants? 5 int '5' char "5" string 5L long int "5.0" string 5.0 double 5.0f float 5.25 double 2. Code the variable declaration and constant definitions: a). a float variable named height b). a char variable named vehicle_type initialized to the character constant C c). a defined constant, UPPER_LIMIT , for 15000 d). a memory constant, tax , initialize to 0.0825 #include <stdio.h> #define UPPER_LIMIT 15000 int main(void) { // Local Definitions const double tax = 0.0825; float height; char vehicle_type = 'C'; // Statements return 0; } 3. Code a statement that will print the following line. Assume the total value is contained in a variable named cost . printf ( " The sales total is: %6.2f\n", cost); 1 T h e s a l e s t o t a l i s : 4 5 . 9 9
Background image of page 1

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

View Full DocumentRight Arrow Icon
CIS 15AG Answers Chapter 2: Introduction to the C Language 4. What is the output displayed by the following program fragment? // Local Definitions
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 09/02/2011 for the course CIS 15BG taught by Professor Staff during the Spring '10 term at DeAnza College.

Page1 / 3

3_Answers_2-1 - CIS 15AG 1 Answers Chapter 2: Introduction...

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

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