This document describes several C programs that print "Hello, world" or print Fahrenheit to Celsius temperature conversion tables. It includes the following C programs:
1. A simple "Hello, world" program using printf.
2. A program that uses a for loop to print a Fahrenheit to Celsius table from 0 to 300 degrees Fahrenheit in 20 degree increments.
3. A program that uses a while loop and getchar/putchar functions to copy input characters to output until end-of-file is reached.
1. The document discusses various types of computer crimes and computer criminals, ranging from novice hackers to organized crime rings.
2. Key cases of computer hacking and crimes are outlined, including the Morris worm of 1988, the "141 Hackers" movie from 1983, and Kevin Mitnick's high-profile hacking incidents.
3. Computer crime statistics are presented on the costs of attacks, number of victims, and average financial losses.
This document discusses computer crime. It begins with an encrypted header and footer on each page. The document then lists numbered sections that likely correspond to different types or cases of computer crimes.
1. The document discusses various types of computer crimes and computer criminals, including hackers, crackers, organized crime rings, and individual perpetrators.
2. Examples are provided of some major computer crimes from the past, such as the Morris worm of 1988 and hacking incidents involving Kevin Mitnick.
3. Computer crime statistics are presented on the costs of attacks, number of victims, and average financial losses.
The document discusses cloud computing and its benefits. It notes that cloud computing allows for access to computing resources from anywhere using an internet connection. Some key benefits mentioned are flexibility, cost savings from not having to maintain physical infrastructure, and scalability to add or remove resources as needed.
Newspaper websites have huge audiences, often 10-20 times larger than their print circulation numbers. However, they are not generating as much ad revenue as expected given these large audiences. The problem seems to be that despite newspapers having millions of unique visitors per month, they have not been able to fully monetize this traffic through advertising.
1. The document discusses various types of computer crime and computer criminals, ranging from novice hackers to organized crime rings.
2. Examples of specific computer crimes are discussed, such as the Morris worm of 1988, hacks on Yahoo and AOL, and the theft of trade secrets from companies by hackers like Kevin Mitnick.
3. Statistics are presented on the large financial losses caused by computer crimes, such as billions lost annually to online theft and fraud.
1. The document discusses various types of computer crime and hackers/crackers, including novice hackers, organized crime groups, hackers for ideological reasons, and con artists.
2. Examples are provided of early computer crimes in the 1980s involving worms and unauthorized access to systems.
3. Statistics are presented on the increasing costs of computer crime to businesses and individuals over the years, now in the billions of dollars.
1. The document discusses various types of computer crimes and computer criminals, ranging from novice hackers to organized crime rings.
2. Key cases of computer hacking and crimes are outlined, including the Morris worm of 1988, the "141 Hackers" movie from 1983, and Kevin Mitnick's high-profile hacking incidents.
3. Computer crime statistics are presented on the costs of attacks, number of victims, and average financial losses.
This document discusses computer crime. It begins with an encrypted header and footer on each page. The document then lists numbered sections that likely correspond to different types or cases of computer crimes.
1. The document discusses various types of computer crimes and computer criminals, including hackers, crackers, organized crime rings, and individual perpetrators.
2. Examples are provided of some major computer crimes from the past, such as the Morris worm of 1988 and hacking incidents involving Kevin Mitnick.
3. Computer crime statistics are presented on the costs of attacks, number of victims, and average financial losses.
The document discusses cloud computing and its benefits. It notes that cloud computing allows for access to computing resources from anywhere using an internet connection. Some key benefits mentioned are flexibility, cost savings from not having to maintain physical infrastructure, and scalability to add or remove resources as needed.
Newspaper websites have huge audiences, often 10-20 times larger than their print circulation numbers. However, they are not generating as much ad revenue as expected given these large audiences. The problem seems to be that despite newspapers having millions of unique visitors per month, they have not been able to fully monetize this traffic through advertising.
1. The document discusses various types of computer crime and computer criminals, ranging from novice hackers to organized crime rings.
2. Examples of specific computer crimes are discussed, such as the Morris worm of 1988, hacks on Yahoo and AOL, and the theft of trade secrets from companies by hackers like Kevin Mitnick.
3. Statistics are presented on the large financial losses caused by computer crimes, such as billions lost annually to online theft and fraud.
1. The document discusses various types of computer crime and hackers/crackers, including novice hackers, organized crime groups, hackers for ideological reasons, and con artists.
2. Examples are provided of early computer crimes in the 1980s involving worms and unauthorized access to systems.
3. Statistics are presented on the increasing costs of computer crime to businesses and individuals over the years, now in the billions of dollars.
1. The document discusses various types of computer crimes and computer criminals, ranging from novice hackers to organized crime rings.
2. Key cases of computer hacking and crimes are outlined, including the Morris worm of 1988, the hacking of Yahoo in 1997, and the hacking of Tsutomu Shimomura by Kevin Mitnick in 1995.
3. Computer crime statistics are presented, with estimates of annual losses ranging from $40-400 billion or more.
This document provides information on developmental counseling in the military. It discusses the purpose of counseling to develop subordinates and help them achieve goals. It describes the different types of counseling including event, performance, and professional growth counseling. The document provides guidance on how to conduct counseling including identifying the need, preparing, conducting, and following up. It also gives examples of adverse counseling and terms used in counseling.
The document discusses employer branding and recruitment touchpoints. It defines employer branding as focusing on initiatives to enhance a company's perception among current employees and external stakeholders. It emphasizes that employer branding requires a long-term, coordinated strategy to attract, retain and motivate talent. The document outlines key aspects of building an employer brand like defining objectives, ensuring brand relevancy and storytelling through multiple communication channels. It also maps out common recruitment touchpoints that shape a candidate's experience.
The document discusses social networking sites (SNS) and microblogging. It mentions Weibo, an important Chinese microblogging platform, and notes the years 2011 and SACC2011, possibly referring to a conference. The repetitive structure discusses transmission of information on SNS and microblogging platforms.
This document contains a summary of a report presented at a conference on mobile technologies, business, and prospects. The summary is divided into five sections:
1. An introduction to mobile learning (M-learning), which involves the use of mobile devices for educational purposes.
2. Sections 2-4 discuss additional aspects of M-learning.
3. Section 5 draws conclusions about M-learning.
This document discusses personal branding and provides steps to build a personal brand. It defines personal brand as a set of perceptions formed by others based on their experiences with an individual. It then lists the key elements of personal brand as passion, commitment, focus and patience. Finally, it outlines a 7 step process to establish a personal brand, which includes conducting a brand audit, assessing your image, determining your identity and positioning your brand.
The document appears to be a series of images showing the logo "F-X Change" in different formats and languages. There are several variations of the logo presented side by side and in some cases additional text is included but it is difficult to read. The overall content seems to be promoting the brand "F-X Change" but specific details about the company or its services are not provided in the summary-length text.
The document describes different methods of communication over the internet including email, chat, voice over IP (VoIP), and video conferencing. E-mail can be used for communication between individuals or groups. Chat options include MSN Messenger. Voice calls can be placed over the internet using VoIP technology instead of traditional phone lines. Video conferencing allows for face-to-face communication online through programs and webcams.
Testing Techniques For Agile Testers - Janet GregoryAGILEMinds
This document discusses techniques for agile testers. It covers test planning at the product, release, and iteration levels. Collaboration and communication are emphasized. The Agile Testing Quadrants framework is introduced for classifying different types of tests based on purpose. Test-driven development (TDD) benefits and quadrant one testing are described, focusing on technology-facing tests that support developers. Automation, test strategy planning, and the testing toolkit are also mentioned.
The document appears to be a list of names that have sent blessings to "His Majesty". It includes over 30 Thai names written in English letters, as well as short messages or notes from some of the names.
This document contains a summary of the table of contents for a physics textbook divided into two volumes. Volume 1 is divided into 5 parts covering topics such as measurement, motion, force, energy, momentum, rotation, oscillations, waves, thermodynamics, and kinetic theory of gases. Volume 2 is divided into 5 additional parts covering electromagnetism, images, interference, diffraction, and relativity, as well as additional topics in modern physics.
The document contains discussions between two individuals, Chang.wangc@alibaba-inc.com and an unknown recipient, about setting up an FX exchange. It includes screenshots of an FX trading platform interface and market share statistics for major internet companies in China.
The document discusses the evolution of the internet and social media:
1. It describes the transition from static Web 1.0 to dynamic Web 2.0 with user-generated content and social networking features.
2. It outlines the rise of social networking services (SNS) like blogs, social bookmarking, media sharing sites, and microblogging platforms.
3. It provides examples of different types of social media including social networks, content communities, social gaming, chat, and discussion forums.
The document discusses personal brand. It begins by asking the reader what they think about brand and personal brand. It then states that many people think personal brand is only important for celebrities, officials, businesspeople or public figures. However, personal brand is important for everyone as it represents their uniqueness and qualities to others. Developing a personal brand allows anyone to market themselves effectively.
N
N
y
y
bu
bu
to
to
k
k
lic
lic
C
C
w
w
m
m
w w
w
w
o
o
.d o .c .d o .c
c u -tr a c k c u -tr a c k
This document introduces a fun way to search for people or things on Google by adding "is" after the name or
thing in quotation marks. Some examples given are searching "Zhang San is" which
A Testers Role On Agile Projects - Janet GregoryAGILEMinds
The document discusses the role of a tester on an agile project. It introduces the speaker's experience with agile testing since 2000. The topics to be covered include learning about the audience members, a brief introduction to agile, the challenges of agile testing, what agile testing is, the life of a tester during an iteration, how testing must keep up with rapid changes, and continual improvement. The goal is to help testers understand their important role within the agile process.
This document discusses the definition of Islamic architecture and whether it can be considered a unique style. It questions whether Islamic architecture refers only to religious buildings like mosques, or all architecture from Muslim lands. It explores how the term "Islamic" is being used and whether there is a recognizable style that differs from non-Islamic cultures. The document suggests identifying typical elements in Islamic architecture that express a culture shaped by Islam in a way that differs from other traditions.
The document contains a series of symbols and characters with no discernible meaning. There are repeating patterns of letters, symbols and blank spaces but no coherent words, sentences or identifiable language.
1. The document discusses various types of computer crimes and computer criminals, ranging from novice hackers to organized crime rings.
2. Key cases of computer hacking and crimes are outlined, including the Morris worm of 1988, the hacking of Yahoo in 1997, and the hacking of Tsutomu Shimomura by Kevin Mitnick in 1995.
3. Computer crime statistics are presented, with estimates of annual losses ranging from $40-400 billion or more.
This document provides information on developmental counseling in the military. It discusses the purpose of counseling to develop subordinates and help them achieve goals. It describes the different types of counseling including event, performance, and professional growth counseling. The document provides guidance on how to conduct counseling including identifying the need, preparing, conducting, and following up. It also gives examples of adverse counseling and terms used in counseling.
The document discusses employer branding and recruitment touchpoints. It defines employer branding as focusing on initiatives to enhance a company's perception among current employees and external stakeholders. It emphasizes that employer branding requires a long-term, coordinated strategy to attract, retain and motivate talent. The document outlines key aspects of building an employer brand like defining objectives, ensuring brand relevancy and storytelling through multiple communication channels. It also maps out common recruitment touchpoints that shape a candidate's experience.
The document discusses social networking sites (SNS) and microblogging. It mentions Weibo, an important Chinese microblogging platform, and notes the years 2011 and SACC2011, possibly referring to a conference. The repetitive structure discusses transmission of information on SNS and microblogging platforms.
This document contains a summary of a report presented at a conference on mobile technologies, business, and prospects. The summary is divided into five sections:
1. An introduction to mobile learning (M-learning), which involves the use of mobile devices for educational purposes.
2. Sections 2-4 discuss additional aspects of M-learning.
3. Section 5 draws conclusions about M-learning.
This document discusses personal branding and provides steps to build a personal brand. It defines personal brand as a set of perceptions formed by others based on their experiences with an individual. It then lists the key elements of personal brand as passion, commitment, focus and patience. Finally, it outlines a 7 step process to establish a personal brand, which includes conducting a brand audit, assessing your image, determining your identity and positioning your brand.
The document appears to be a series of images showing the logo "F-X Change" in different formats and languages. There are several variations of the logo presented side by side and in some cases additional text is included but it is difficult to read. The overall content seems to be promoting the brand "F-X Change" but specific details about the company or its services are not provided in the summary-length text.
The document describes different methods of communication over the internet including email, chat, voice over IP (VoIP), and video conferencing. E-mail can be used for communication between individuals or groups. Chat options include MSN Messenger. Voice calls can be placed over the internet using VoIP technology instead of traditional phone lines. Video conferencing allows for face-to-face communication online through programs and webcams.
Testing Techniques For Agile Testers - Janet GregoryAGILEMinds
This document discusses techniques for agile testers. It covers test planning at the product, release, and iteration levels. Collaboration and communication are emphasized. The Agile Testing Quadrants framework is introduced for classifying different types of tests based on purpose. Test-driven development (TDD) benefits and quadrant one testing are described, focusing on technology-facing tests that support developers. Automation, test strategy planning, and the testing toolkit are also mentioned.
The document appears to be a list of names that have sent blessings to "His Majesty". It includes over 30 Thai names written in English letters, as well as short messages or notes from some of the names.
This document contains a summary of the table of contents for a physics textbook divided into two volumes. Volume 1 is divided into 5 parts covering topics such as measurement, motion, force, energy, momentum, rotation, oscillations, waves, thermodynamics, and kinetic theory of gases. Volume 2 is divided into 5 additional parts covering electromagnetism, images, interference, diffraction, and relativity, as well as additional topics in modern physics.
The document contains discussions between two individuals, Chang.wangc@alibaba-inc.com and an unknown recipient, about setting up an FX exchange. It includes screenshots of an FX trading platform interface and market share statistics for major internet companies in China.
The document discusses the evolution of the internet and social media:
1. It describes the transition from static Web 1.0 to dynamic Web 2.0 with user-generated content and social networking features.
2. It outlines the rise of social networking services (SNS) like blogs, social bookmarking, media sharing sites, and microblogging platforms.
3. It provides examples of different types of social media including social networks, content communities, social gaming, chat, and discussion forums.
The document discusses personal brand. It begins by asking the reader what they think about brand and personal brand. It then states that many people think personal brand is only important for celebrities, officials, businesspeople or public figures. However, personal brand is important for everyone as it represents their uniqueness and qualities to others. Developing a personal brand allows anyone to market themselves effectively.
N
N
y
y
bu
bu
to
to
k
k
lic
lic
C
C
w
w
m
m
w w
w
w
o
o
.d o .c .d o .c
c u -tr a c k c u -tr a c k
This document introduces a fun way to search for people or things on Google by adding "is" after the name or
thing in quotation marks. Some examples given are searching "Zhang San is" which
A Testers Role On Agile Projects - Janet GregoryAGILEMinds
The document discusses the role of a tester on an agile project. It introduces the speaker's experience with agile testing since 2000. The topics to be covered include learning about the audience members, a brief introduction to agile, the challenges of agile testing, what agile testing is, the life of a tester during an iteration, how testing must keep up with rapid changes, and continual improvement. The goal is to help testers understand their important role within the agile process.
This document discusses the definition of Islamic architecture and whether it can be considered a unique style. It questions whether Islamic architecture refers only to religious buildings like mosques, or all architecture from Muslim lands. It explores how the term "Islamic" is being used and whether there is a recognizable style that differs from non-Islamic cultures. The document suggests identifying typical elements in Islamic architecture that express a culture shaped by Islam in a way that differs from other traditions.
The document contains a series of symbols and characters with no discernible meaning. There are repeating patterns of letters, symbols and blank spaces but no coherent words, sentences or identifiable language.
This document describes an iOS-ROS interface that allows communication between an iPhone app and Corobots. The app uses QR codes and Google Firebase authentication to localize the user's location on the RIT CS floor. It can then dispatch Corobots to that location and view the Corobot's live Kinect video stream. The interface includes a ROS package that transmits Kinect and Corobot status data to a web server, which the iPhone app can access to get information about active Corobots.
El documento describe el guión para un simulacro de sismo que se llevará a cabo el 20 de marzo de 2013 en la Escuela Primaria "21 de Agosto" en Joigelito, Chiapas. El simulacro incluirá la activación de alarmas, evacuación del personal a zonas seguras, búsqueda y rescate de posibles heridos, atención médica y comunicación con servicios de emergencia. Al finalizar, se realizará una reunión de evaluación para analizar el desarrollo del simulacro.
The document discusses the problem of monetizing news media websites. While news sites report huge audience numbers in unique visitors per month, often much higher than their print circulation, they fail to generate comparable advertising revenue to print. This is because the metrics of unique visitors and time spent are poor measures of a site's actual audience. Upon closer examination, people spend very little time on news sites, less than 1.5 minutes per day on average. In contrast, print newspapers still engage over 40 million French readers spending 28 minutes daily, generating 20 times the audience of online news. This disparity explains why news websites struggle to monetize their "eyeballs" effectively.
The document appears to be a presentation discussing Naver's mobile app platform and strategy. It provides statistics on daily active users and revenues over several periods. It also discusses Naver's goals of aligning its social network services with mobile and outlines its plans to support developers and grow its mobile app business from 2011 through early 2012.
The document discusses several models of organizational culture:
1) The F-X Change model presents culture as shared assumptions that guide behavior and are taken for granted.
2) The Denison model views culture as deep structure of organizations involving shared values, beliefs, and behaviors.
3) Edgar Schein's model proposes that culture consists of observable artifacts, espoused values, and deep basic underlying assumptions.
Women are projected to make up the majority of the US labor force for the first time in history. This will have significant economic impacts as women increasingly control household spending and incomes. Small community banks are gaining market share by marketing themselves as more trustworthy alternatives to the large banks that received government bailouts. Tax rebate checks are expected to provide a short-term boost to the economy, with women and young adults planning to spend the largest portions of their checks.
This document provides floor plans and details for the Castleton home design. The 3 bedroom, 2.5 bathroom home has a total square footage of 4,151 square feet with 2,521 square feet on the main level and 1,630 square feet on the second level. The front elevation drawing and plan features are also included.
The document discusses a presentation given by Carolyn Jenkins on the future of simulation for healthcare education. The presentation explored how simulation will be interconnected with technology, pedagogy, people, society, and culture. A power point from the presentation is available online. The document also provides references cited in the presentation.
This document provides specifications for locating pins with diameters ranging from 6mm to 19mm. It includes dimensions for the pins like radii, depth, and tolerances. Charts list National Aerospace and Defense Contractors Accreditation Program (NAAMS) codes, dimensions, and weights for each pin size. Pins are made of SAE 8620 steel and hardened to 58-62 Rockwell C.
1. H H
F-XC A N GE F-XC A N GE
PD PD
!
!
W
W
O
O
N
N
y
y
bu
bu
to
to
k
k
lic
lic
C
C
w
w
m
m
w w
w
w
o
o
.d o .c .d o .c
c u-tr a c k c u-tr a c k
1
C C
C
C
C
1.1.
hello, world
C “hello, world
#include <stdio.h>
main()
{
printf("hello, worldn");
}
UNIX
2. H H
F-XC A N GE F-XC A N GE
PD PD
!
!
W
W
O
O
N
N
y
y
bu
bu
to
to
k
k
lic
lic
C
C
w
w
m
m
w w
w
w
o
o
.d o .c .d o .c
c u-tr a c k c u-tr a c k
“.c hello.c
cc hello.c
a.out
a.out
a.out
hello, world
#include <stdio.h>
main() main
{ main
printf("hello, worldn"); main printf
} n
C
C
C Fortran Pascal
main main
—— main
main
main
#include <stdio.h>
C
7 B
main
()
{} main
printf("hello, worldn");
"hello,
worldn" printf printf
"hello, worldn"
printf
C n
n
3. H H
F-XC A N GE F-XC A N GE
PD PD
!
!
W
W
O
O
N
N
y
y
bu
bu
to
to
k
k
lic
lic
C
C
w
w
m
m
w w
w
w
o
o
.d o .c .d o .c
c u-tr a c k c u-tr a c k
printf n n
printf("hello, world
");
C
printf
#include <stdio.h>
main()
{
printf("hello, ");
printf("world");
printf("n");
}
n n
C t
b " 2.3
1-1 “hello, world
1-2 printf c c
1.2.
=(5/9)( -32)
1 -17
20 -6
40 4
60 15
80 26
100 37
120 48
140 60
160 71
180 82
200 93
220 104
240 115
260 126
280 137
300 148
main “hello, world
4. H H
F-XC A N GE F-XC A N GE
PD PD
!
!
W
W
O
O
N
N
y
y
bu
bu
to
to
k
k
lic
lic
C
C
w
w
m
m
w w
w
w
o
o
.d o .c .d o .c
c u-tr a c k c u-tr a c k
#include <stdio.h>
/* fahr=0 20 … 300
*/
main()
{
int fahr, celsius;
int lower, upper, step;
lower = 0; /* */
upper = 300; /* */
step = 20; /* */
fahr = lower;
while (fahr <= upper) {
celsius = 5 * (fahr-32) / 9;
printf("%dt%dn", fahr, celsius);
fahr = fahr + step;
}
}
/* fahr=0 20 … 300
*/
/* */
C
int fahr, celsius;
int lower, upper, step;
int float
int float int
16 -32768 32767 32 int float
-38 38
32 6 10 10
int float C
char ——
short
long
double
4
5. H H
F-XC A N GE F-XC A N GE
PD PD
!
!
W
W
O
O
N
N
y
y
bu
bu
to
to
k
k
lic
lic
C
C
w
w
m
m
w w
w
w
o
o
.d o .c .d o .c
c u-tr a c k c u-tr a c k
lower = 0;
upper = 300;
step = 20;
fahr = lower;
while
while (fahr <= upper) {
...
}
while
(fahr<=upper) 3
(fahr>upper)
while
while
while (i < j)
i = 2 * i;
while
C
celsius = 5 * (fahr - 32) / 9
celsius
5 9 5 / 9 C
5 9
5 / 9 0 0
printf printf
7 %
……
%d
printf(" %dt%dn", fahr, celsius);
fahr celsius t
printf % ……
6. H H
F-XC A N GE F-XC A N GE
PD PD
!
!
W
W
O
O
N
N
y
y
bu
bu
to
to
k
k
lic
lic
C
C
w
w
m
m
w w
w
w
o
o
.d o .c .d o .c
c u-tr a c k c u-tr a c k
printf C C
printf C
ANSI printf
C 7
7
7.4 scanf scanf printf
printf
%d
printf(" %3d %6dn", fahr, celsius);
fahr celsius fahr 3 celsius 6
0 -17
20 -6
40 4
60 15
80 26
100 37
...
0 -17.8 -17
#include <stdio.h>
/* print Fahrenheit-Celsius table
for fahr = 0, 20, ..., 300; floating-point version */
main()
{
float fahr, celsius;
float lower, upper, step;
lower = 0; /* lower limit of temperatuire scale */
upper = 300; /* upper limit */
step = 20; /* step size */
fahr = lower;
while (fahr <= upper) {
celsius = (5.0/9.0) * (fahr-32.0);
printf("%3.0f %6.1fn", fahr, celsius);
fahr = fahr + step;
}
}
fahr celsius float
5 / 9
7. H H
F-XC A N GE F-XC A N GE
PD PD
!
!
W
W
O
O
N
N
y
y
bu
bu
to
to
k
k
lic
lic
C
C
w
w
m
m
w w
w
w
o
o
.d o .c .d o .c
c u-tr a c k c u-tr a c k
0
5.0 / 9.0
fahr – 32 32
2
fahr = lower;
while (fahr <= upper)
int float
printf %3.0f fahr 3
%6.1f celsius 6
1
0 -17.8
20 -6.7
40 4.4
...
%6f 6 %.2f
%f
%d
%6d 6
%f
%6f 6
%.2f
%6.2f 6
printf %o %x %c
%s %% %
1-3
1-4
1.3. for
#include <stdio.h>
8. H H
F-XC A N GE F-XC A N GE
PD PD
!
!
W
W
O
O
N
N
y
y
bu
bu
to
to
k
k
lic
lic
C
C
w
w
m
m
w w
w
w
o
o
.d o .c .d o .c
c u-tr a c k c u-tr a c k
/* — */
main()
{
int fahr;
for (fahr = 0; fahr <= 300; fahr = fahr + 20)
printf("%3d %6.1fn", fahr, (5.0/9.0)*(fahr-32));
}
int fahr for
printf
C
printf
%6.1f
for while for
while for 3
fahr = 0
fahr <= 300
true
printf
fahr = fahr + 20
fahr faise
while for
whi1e for
for
while
1-5 300 0
1.4.
300 20
#define
9. H H
F-XC A N GE F-XC A N GE
PD PD
!
!
W
W
O
O
N
N
y
y
bu
bu
to
to
k
k
lic
lic
C
C
w
w
m
m
w w
w
w
o
o
.d o .c .d o .c
c u-tr a c k c u-tr a c k
#define
#define
#include <stdio.h>
#define LOWER 0 /* lower limit of table */
#define UPPER 300 /* upper limit */
#define STEP 20 /* step size */
/* print Fahrenheit-Celsius table */
main()
{
int fahr;
for (fahr = LOWER; fahr <= UPPER; fahr = fahr + STEP)
printf("%3d %6.1fn", fahr, (5.0/9.0)*(fahr-32));
}
LOWER UPPER STEP
#define
1.5.
0
C
getchar putchar
getchar
c = getchar()
c
7
putchar
putchar()
c putchar printf
10. H H
F-XC A N GE F-XC A N GE
PD PD
!
!
W
W
O
O
N
N
y
y
bu
bu
to
to
k
k
lic
lic
C
C
w
w
m
m
w w
w
w
o
o
.d o .c .d o .c
c u-tr a c k c u-tr a c k
1.5.1.
getchar putchar
while ( )
C
#include <stdio.h>
/* copy input to output; 1st version */
main()
{
int c;
c = getchar();
while (c != EOF) {
putchar(c);
c = getchar();
}
}
!=
char int
int
C
getchar
EOF end of file c
getchar c char
EOF c int
EOF <stdio.h>
char
C C
c = getchar()
c while
#include <stdio.h>
11. H H
F-XC A N GE F-XC A N GE
PD PD
!
!
W
W
O
O
N
N
y
y
bu
bu
to
to
k
k
lic
lic
C
C
w
w
m
m
w w
w
w
o
o
.d o .c .d o .c
c u-tr a c k c u-tr a c k
/* copy input to output; 2nd version */
main()
{
int c;
while ((c = getchar()) != EOF)
putchar(c);
}
while c
while
while while main
getchar
while !=
= != =
c = getchar() != EOF
c = (getchar() != EOF)
c 0 1 getchar
2
1-6 getchar() != EOF 0 1
1-7 EOF
1.5.2.
#include <stdio.h>
/* count characters in input; 1st version */
main()
{
long nc;
nc = 0;
while (getchar() != EOF)
++nc;
printf("%ldn", nc);
}
12. H H
F-XC A N GE F-XC A N GE
PD PD
!
!
W
W
O
O
N
N
y
y
bu
bu
to
to
k
k
lic
lic
C
C
w
w
m
m
w w
w
w
o
o
.d o .c .d o .c
c u-tr a c k c u-tr a c k
++nc;
++ 1 nc = nc + 1
++nc -- ++ --
++nc nc++
2 ++nc nc++ nc 1
long int long
32 int long
int 16 32767
int %ld printf
long
double while
for
#include <stdio.h>
/* count characters in input; 2nd version */
main()
{
double nc;
for (nc = 0; gechar() != EOF; ++nc)
;
printf("%.0fn", nc);
}
float double printf %f %.0f
0
for
C for
for
getchar while for
0 whi1e for
0
while for
1.5.3.
#include <stdio.h>
13. H H
F-XC A N GE F-XC A N GE
PD PD
!
!
W
W
O
O
N
N
y
y
bu
bu
to
to
k
k
lic
lic
C
C
w
w
m
m
w w
w
w
o
o
.d o .c .d o .c
c u-tr a c k c u-tr a c k
/* count lines in input */
main()
{
int c, nl;
nl = 0;
while ((c = getchar()) != EOF)
if (c == 'n')
++nl;
printf("%dn", nl);
}
while if ++nl if
== C Pascal = Fortran
.EQ. C = ==
== C
= 2
'A'
ASCII 65 A 65 'A' 65
'A'
'n'
ASCII 10 'n'
"n"
2
1-8
1-9
1-10 t
b
1.5.4.
4
UNIX
wc
#include <stdio.h>
#define IN 1 /* inside a word */
#define OUT 0 /* outside a word */
14. H H
F-XC A N GE F-XC A N GE
PD PD
!
!
W
W
O
O
N
N
y
y
bu
bu
to
to
k
k
lic
lic
C
C
w
w
m
m
w w
w
w
o
o
.d o .c .d o .c
c u-tr a c k c u-tr a c k
/* count lines, words, and characters in input */
main()
{
int c, nl, nw, nc, state;
state = OUT;
nl = nw = nc = 0;
while ((c = getchar()) != EOF) {
++nc;
if (c == 'n')
++nl;
if (c == ' ' || c == 'n' || c = 't')
state = OUT;
else if (state == OUT) {
state = IN;
++nw;
}
}
printf("%d %d %dn", nl, nw, nc);
}
state
OUT
IN OUT 1 0
nl = nw = nc = 0;
3 nl nw nc 0
n1 = (nw = (nc = 0));
|| OR
if (c == ' ' || c== 'n' || c == 't')
c c c t
&& AND ||
&& ||
c
else if
if ( )
1
else
2
15. H H
F-XC A N GE F-XC A N GE
PD PD
!
!
W
W
O
O
N
N
y
y
bu
bu
to
to
k
k
lic
lic
C
C
w
w
m
m
w w
w
w
o
o
.d o .c .d o .c
c u-tr a c k c u-tr a c k
if-else
1 2
else if if
1-11
’
1-12
1.6.
C
12
10
#include <stdio.h>
/* count digits, white space, others */
main()
{
int c, i, nwhite, nother;
int ndigit[10];
nwhite = nother = 0;
for (i = 0; i < 10; ++i)
ndigit[i] = 0;
while ((c = getchar()) != EOF)
if (c >= '0' && c <= '9')
++ndigit[c-'0'];
else if (c == ' ' || c == 'n' || c == 't')
++nwhite;
else
++nother;
printf("digits =");
for (i = 0; i < 10; ++i)
printf(" %d", ndigit[i]);
printf(", white space = %d, other = %dn",
nwhite, nother);
}
digits = 9 3 0 0 0 0 0 0 0 1, white space = 123, other = 345
int ndigit[10]
ndigit 10 C 0
16. H H
F-XC A N GE F-XC A N GE
PD PD
!
!
W
W
O
O
N
N
y
y
bu
bu
to
to
k
k
lic
lic
C
C
w
w
m
m
w w
w
w
o
o
.d o .c .d o .c
c u-tr a c k c u-tr a c k
10 ndigit[0] ndiglt[1] ndigit[9]
for
i
if (c >= '0' && c <= '9')
c
c- '0'
'0' '1' '9'
char char
int c - '0'
c '0' '9' 0 9 ndigit
if (c >= '0' && c <= '9')
++ndigit[c-'0'];
else if (c == ' ' || c == 'n' || c == 't')
++nwhite;
else
++nother;
if ( 1)
1
else if ( 1)
2
...
...
else
n
else
else
if else 0
else if ( )
if else
3 switch
3.4
17. H H
F-XC A N GE F-XC A N GE
PD PD
!
!
W
W
O
O
N
N
y
y
bu
bu
to
to
k
k
lic
lic
C
C
w
w
m
m
w w
w
w
o
o
.d o .c .d o .c
c u-tr a c k c u-tr a c k
switch
1-13
1-14
1.7.
C Fortran Pascal
C
printf getchar putchar
C Fortran
** power(m, n)
power(m, n) m n n power(2,
5) 32
xy pow(x, y)
power(m, n)
#include <stdio.h>
int power(int m, int n);
/* test power function */
main()
{
int i;
for (i = 0; i < 10; ++i)
printf("%d %d %dn", i, power(2,i), power(-3,i));
return 0;
}
/* power: raise base to n-th power; n >= 0 */
int power(int base, int n)
{
int i, p;
p = 1;
for (i = 1; i <= n; ++i)
p = p * base;
return p;
}
(0 )
18. H H
F-XC A N GE F-XC A N GE
PD PD
!
!
W
W
O
O
N
N
y
y
bu
bu
to
to
k
k
lic
lic
C
C
w
w
m
m
w w
w
w
o
o
.d o .c .d o .c
c u-tr a c k c u-tr a c k
{
}
main power
C
main power
printf("%d %d %dn", i, power(2, i), power(-i, 3));
main power power main
power(2, i) 2 i
4
power
int power(int base, int n)
power power
i p power i main i
power return main return
return ;
return
main return main
0 0
main return main return
main
int power(int m, int n);
power int int
power
19. H H
F-XC A N GE F-XC A N GE
PD PD
!
!
W
W
O
O
N
N
y
y
bu
bu
to
to
k
k
lic
lic
C
C
w
w
m
m
w w
w
w
o
o
.d o .c .d o .c
c u-tr a c k c u-tr a c k
int power(int, int);
ANSI C C
C power
/* power: raise base to n-th power; n >= 0 */
/* (old-style version) */
power(base, n)
int base, n;
{
int i, p;
p = 1;
for (i = 1; i <= n; ++i)
p = p * base;
return p;
}
int ANSI C
C power
int power();
power
power int
ANSI C
ANSI C
1-15 1.2
1.8. ——
Fortran C
C
Fortran Pascal var
C
power