THEORY AND PROBLEMS OF PROGRAMMING WITH C(Second Edition)
BYRON S. GOTTFRIED, Ph.D.
Professor of Industrial Engineering
University ofPittsburgh
SCHAUM’S OUTLINE SERIES
McGRAW -HILL
New York St. Lauis San Francisco Auckland Bogota’ Caracas
Lisbon London Madrid Mexico City Milan Montreal
New Delhi San Juan Singapore
Sydney Tokyo Toronto
/* program to calculate the area of a circle */ /* TITLE (COMMENT) */
#include <stdio.h> /* LIBRARY FILE ACCESS */
main( ) /* FUNCTION HEADING */
float radius, area; /*
VARIABLE DECLARATIONS */
printf ("Radius = ? /* OUTPUT STATEMENT (PROMPT) *I 'I);
'I, scanf ( "%f &radius) ; I*
INPUT STATEMENT */
area = 3.14159 * radius * radius; /*
ASSIGNMENT STATEMENT */
printf ("Area = %f",area) ; /*
OUTPUT STATEMENT */
1
No comments:
Post a Comment