,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
, Table 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 ................................Error! Bookmark not defined.
Variable Initialization in C ...............................Error! Bookmark not defined.
Lvalues and Rvalues in C ............................................................................. 15
C Constants and Literals ........................................................ 17
Integer literals............................................................................................ 17
Floating-point literals.................................................................................. 18
Character constants.................................................................................... 18
iii
The benefits of buying summaries with Stuvia:
Guaranteed quality through customer reviews
Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.
Quick and easy check-out
You can quickly pay through credit card or Stuvia-credit for the summaries. There is no membership needed.
Focus on what matters
Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!
Frequently asked questions
What do I get when I buy this document?
You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.
Satisfaction guarantee: how does it work?
Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.
Who am I buying these notes from?
Stuvia is a marketplace, so you are not buying this document from us, but from seller iqrafatima. Stuvia facilitates payment to the seller.
Will I be stuck with a subscription?
No, you only buy these notes for $7.49. You're not tied to anything after your purchase.