Introduction to Computer Systems Chapter 18

Introduction to Computer Systems Chapter 18 - Chapter 18...

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

View Full Document Right Arrow Icon

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

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Chapter 18 18.1 a. printf("an integer: %d\n a string: %s\n and a float %f\n", 111, "Eleventy One", 111.11); b. printf("Tel Number :(%d)-%d-%d\n", areaCode, exchange, number); c. printf("ID Number: %s-%s-%s\n", idPart1, idPart2, idPart3); d. scanf("%d-%d-%d",&id1, &id2, &id3); e. scanf("%s ,%s , %c %d %c", first, last, &middle, &age, &sex); 18.3 So that the user can edit the input stream before hitting enter and thereby confirming the input. 18.5 The %d format specification causes printf to output the next parameter (in this case the value of x, which happens to be a floating point number) as an integer value. In this case, the bit pattern for x is interpreted as an integer. 18.7 a. 46 29 BlueMoon b. 46 0 BlueMoon c. 111 999 888 18.9 #include <stdio.h> #include <string.h> #include <ctype.h> #define LIMIT 20 struct freq_t { int freq ; char word[100]; }; enum state_t { IN, OUT }; int LAST; int nstrings = 0; int nwords = 0; struct freq_t words[LIMIT]; void Initialize(void); void Getwords(FILE* fin);...
View Full Document

This note was uploaded on 03/30/2008 for the course ECE 252 taught by Professor Wood during the Spring '08 term at Wisconsin.

Page1 / 5

Introduction to Computer Systems Chapter 18 - Chapter 18...

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