slide02 - ICS 103: Computer Programming in C Handout-2...

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

View Full Document Right Arrow Icon
ICS 103: Computer Programming in C Handout-2 Topic : Overview of C. Objective: To know about C Language Elements. To know about general format and syntax of simple C program. To know about variable declaration / identifiers and reserved key words in C. C LANGUAGE ELEMENTS: Preprocessor Directives: #include Directive for Defining identifiers from Standard Libraries : Syntax : #include<standard header file > e.g #include <stdio.h> #include<math.h> #define Directive for creating constant : Syntax : #define NAME value e.g #define PI 3.141593 #define MILES_PER_KM 0.62137 #define MAX_LENGTH 100 From this each identifier NAME is replaced by the constant value and this value will be remaining fixed (constant) throughout the whole program. Example: C program to find addition of two numbers is: /* To find sum of two numbers */ #include <stdio.h> // preprocessor directive int main (void) // main function { int number1, number2, sum; // variable declarations printf ("Please input two numbers : ");
Background image of page 1

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

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

This note was uploaded on 05/09/2010 for the course ICS 102 taught by Professor Zaman during the Spring '10 term at Abilene Christian University.

Page1 / 3

slide02 - ICS 103: Computer Programming in C Handout-2...

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

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