C Programming Tutorial

Only available on StudyMode
  • Download(s) : 97
  • Published : April 7, 2013
Open Document
Text Preview
C Programming Tutorial

C PROGRAMMING TUTORIAL

Simply Easy Learning by tutorialspoint.com

tutorialspoint.com
i

COPYRIGHT & DISCLAIMER NOTICE



All the content and graphics on this tutorial are the property of tutorialspoint.com. Any content from tutorialspoint.com or this tutorial may not be redistributed or reproduced in any way, shape, or form without the written permission of tutorialspoint.com. Failure to do so is a violation of copyright laws. This tutorial may contain inaccuracies or errors and tutorialspoint provides no guarantee regarding the accuracy of the site or its contents including this tutorial. If you discover that the tutorialspoint.com site or this tutorial content contains some errors, please contact us at webmaster@tutorialspoint.com

ii

T able of Contents
C Language Overview .............................................................. 1 Facts about C ............................................................................................... 1 Why to use C ? ............................................................................................. 2 C Programs .................................................................................................. 2

C Environment Setup ............................................................... 3 Text Editor ................................................................................................... 3 The C Compiler ............................................................................................ 3 Installation on Unix/Linux ............................................................................. 4 Installation on Mac OS .................................................................................. 4 Installation on Windows ............................................................................... 4

C Program Structure ................................................................ 5 C Hello World Example ................................................................................. 5 Compile & Execute C Program ....................................................................... 6

C Basic Syntax ......................................................................... 7 Tokens in C .................................................................................................. 7 Semicolons ; ................................................................................................ 7 Comments ................................................................................................... 8 Identifiers .................................................................................................... 8 Keywords .................................................................................................... 8 Whitespace in C ........................................................................................... 9

C Data Types ......................................................................... 10 Integer Types ............................................................................................. 10 Floating-Point Types ................................................................................... 11 The void Type ............................................................................................ 12

C Variables ............................................................................ 13 Variable Declaration in C ............................................................................. 13 Variable Initialization in C ............................................................................ 14 Lvalues and Rvalues in C ............................................................................. 15

C Constants and Literals ........................................................ 16 Integer literals............................................................................................ 16 Floating-point...
tracking img