Sei sulla pagina 1di 19

For

Computer Science Students


Information Technology
&
Software Engineering
University of Sindh.
All CS,IT,SE, Students
Introduction to C Language
 C Programing language is a standardized
Programming Language which was developed by
Dennis Ritchie and ken Thompson in early at Bells
Lab.
 It was one of the most widely used programming
languages.
 It was designed to provide the access to low-level
memory and to require less run time support
STEPS TO LEARN C LANGUAGE

Alphabets Constants
Digits Variables
Special Symbols Keywords Instruction

Program
v C

Alphabets
Character sets
Digits
Special Symbols


The Character Set

 Alphabets A,B,C……XYX a,b,c…………..xyz

 Digits 0,1,2,3,4,5,6,7,8,9,

 Special Character %$#&*()@!~+}{“:?><


Constants , Variable, & Keyword

• Constants :
A constants is an entity that doesn’t
change. It is also called literal.
• Variable:
A variable is an entity that doesn’t
change and also called identifiers.
• Keyword:
A key word is a word that carries
special meaning.
Types of C Constant
C constants

Primary Constants Secondary Constants

Array
Integer Constants Pointer
Structure
Real Constants
Union
Character Enum
C Keywords
• There are only 32 keywords
available in C language

• The keywords can not be


used as variables means
32 keywords of C
1. auto double int struct
Break else long Switch
3.case enum register Typedef
Char enturn return Union
const float short Unsigned
continue for Sigmed Void
default goto sizeof Volatile
do if static 32. white
#include <studio.h>
Int main (void)
{
clrscr();
printf (“Azhar Hussain”)
getch();
}
Explanations
What is #include?
#include is Preprocessor.
Preprocessor:
The C preprocessor is a
macro pre preprocessor that transfers
the program before it id complied.
Some of the common users of C preprocessor

Include Header Files


Macros
Condition Complication
HEADER FILES

Header Files: is a file which contain C


function declaration which is to be shared
between various Source file .
 It has two types
 The files which programmer writes
 The files which comes with compiles
Table of Header files
• <Complex.h>
• A set of function for Manipulating complex numbers
• <ctype.h>
• Defines set of functions used to classify character by
their type or to convert b/w upper and lower case
• <errno.h>
• For testing errors codes reported by library function
• <float.h>
• Defines macro constants specifying the
implementation specific of the floating point library
• <Inttypes.h>
Defines exact width integer types.
• <math.h>
Defines common mathematical function
• <stdbool.h>
Defines a boolen data type
<stddef.h>
Defines several useful types and macros
<stdio.h>
Defines core input and output functions.
<stdlib>
Defines numeric conversation functions,
pseudo-random numbers generation functions-
memory allocation process control functions.
E.T.C
Int main void()
It is the starting point turn where the
execution of the C program begins.
The execution begins with the main ()
function.
{}
{ } used to define a scope.

All functions and control


statements always start and ends
with the early brackets.
 The printf if predefined standard function
to point the given string
 Example printf (“hello World”);
 Output

Hello World
Return 0;
• The statement a terminate to inform .
• The value from main () and 0
indicates the successful
termination.

Potrebbero piacerti anche