Docsity

C Programming: Understanding Variables, Data Types, Keywords, and Program Structure, High school final essays of Computer science

Partial preview of the text

Download C Programming: Understanding Variables, Data Types, Keywords, and Program Structure and more High school final essays Computer science in PDF only on Docsity!

Va r iable s

Va r iable i s t he name of a memo ry loca t ion w hich st o r e s s ome da t a. 25 S a b Memo ry

Va r iable s

R u le s a. Va r iable s a r e ca s e s en s i t i v e b. 1st cha r ac t e r i s alphabe t o r '_' c. no comma / blank s pace d. No o t he r sy mbol o t he r t han '_'

Con st an ts

Val u e s t ha t don 't change ( fi x ed ) T y pe s In t ege r Con st an ts Cha r ac t e r Real Con st an ts Con st an **ts 1 , 2 , 3 , 0 , - 1 , - 2

  1. 0 , 2. 0 ,
  2. 14 , - 24 '** a ', ' b ', ' A ', '#', '&'

32 Ke yw o r d s in C

Ke yw o r d s

Re s e rv ed w o r d s t ha t ha v e s pecial meaning t o t he compile r

P r og r am S tru c tur e

#include<stdio.h> int main() { printf("Hello World"); return 0 ; }

Commen ts

Single Line M u l t iple Line Line s t ha t a r e no t pa rt of p r og r am // / /

O ut p ut

p r in t f (" age i s % d ", age ); p r in t f (" v al u e of pi i s % f ", pi ); p r in t f (" st a r look s like t hi s % c ", st a r);

CASES

1. in t ege **rs

  1. r** eal n u mbe rs 3. cha r ac t e rs

Inp ut

s canf (" % d ", & age );