CSE -- Lec 6

CSE -- Lec 6 - Basics of C Example Code #include...

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

View Full Document Right Arrow Icon
Basics of C Example Code #include<stdio.h> #define PI 3.14159 /*Finds the area and circumference of circle with radius r */ main (void) { double radius, /*radius of circle*/ circumference, /*circumference of circle*/ area; /*area of circle*/ /*get radius of circle*/ printf( “Please enter radius”); scanf( “%lf”, &radius ); /*compute area and circumference*/ area = PI * radius * radius; circumference = 2 * PI * radius; /*display the result*/ printf(“The are of the circle is %f and its circumference is %f\n”, area, circumference); return 0; }/*main*/ %d --- decimal point %f --- real %c --- character Basics of C Form of a Simple C Program Preprocessor directives main ( void ) { declarations executable statements } Basics of C Preprocessor Directive
Background image of page 1

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

View Full DocumentRight Arrow Icon
#include <standard header file> The C langauge includes only minimal set of operations Many useful functions and symbols are contained in libraries Each library has a standard header file which has a name ending in .h The
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 04/15/2010 for the course CSE 1310 taught by Professor Staff during the Spring '08 term at UT Arlington.

Page1 / 5

CSE -- Lec 6 - Basics of C Example Code #include...

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