0% found this document useful (0 votes)
10 views

Lecture 1-Introduction to C

The document provides an overview of the C programming language, its history, and its significance in computer science, particularly in relation to the UNIX operating system. It discusses various components such as header files, data types, and basic program structure, including examples of syntax and functions. Additionally, it outlines the use of constants, keywords, and the importance of data types in C programming.

Uploaded by

t190584207
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views

Lecture 1-Introduction to C

The document provides an overview of the C programming language, its history, and its significance in computer science, particularly in relation to the UNIX operating system. It discusses various components such as header files, data types, and basic program structure, including examples of syntax and functions. Additionally, it outlines the use of constants, keywords, and the importance of data types in C programming.

Uploaded by

t190584207
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

Page No

-Crogramning
Date

Cisa qeoeal- puxpose, pCcdural impexative


ComputeI progxamminq anquage deve loped in
1972 by Dennis N. Ritchie at theBe lt
Te le phonc labosaties to develope the UNIX
Opesatíng Syste m
C is most cidely used Compute language
Tt keeps fluctuating at numbea One Scalc
populagity alonq cith java.

Text editorCompiler Conso le


C.editor

"Xe

olp
SCa¢en
Des BoX
Visua studio
Code Blocks

Saved coith C exteosion


progTams
TurboC’ Dist BIN
Stoged at

Header Eiles -
has umexious Jibaaxes that
C language-defined functions to make
inclucle prec
easieI
psngrammninq
languaqe ,headefile s Contains the Set
To C ibaay funcoos.
of pre-defined standazd
Page .
Date

your Yequest to USe beodeg file in youx


prbgram by
disectve
include it
# include' " woithCprepros;.
AL the heades fGle haYe
By including heade
a
.5extension
Cao
file ,oe Can Se
Conteots Our pDgans.

< studio. h>- T5is headez fle stands fox


standazd input and Output used to take
ioput with help of scanf O0 and pziatf )
fuoctions Tesp.
Siosteom.hzIoput Otput usíDq
an cout usibg Cio
incPP
KStioq.h>perfoms
nelatedto
Various functfons
string
Kmatbh> perfomg mathematical opcgaions
Lke
Sqrtc) log2()
2.()pool

Ktime.b peatem
handing
date ( functioos,
time O
Telated to

*loat h pegfoms Opeyations Telaed


to
floatinq point
Page No.
Date

Basic program
Structuze
# inc ude <
studio.h
include < conioh
Void maio ()

printf\welcame »)
qeth O;

clscg)-USe cleasprevious olp


Screeo, and pxints Deco

getch get chazactez exizts the pOGTam

Statement oo
piotf0- uSed to print
Console
coe(an use ( L as be loc)

int
flogt - f

pointf (0 klelcome");
Value of oumbez
pintf ("

Scaof£ O;- used to


to gead fozmated input

Syntax :
a - NO.
S t o e s value
of input
Data

on Deo line
used to priot olp
-

print Space
used to priot betuees
too Values.

ignoTe Content betoe


Comments- To igooTe

Single Jioe Commeot

-Multiple lioe
inc Comment-=+|

Data-typcs.
Primitive Void Dezivec Enumeatfon

int
flogt Arnay
chaz strings
Structuxe
Jong unlon
double
insigned
Signech

Agay Stores gimiiag data type


int a L5; - Store S values of int.
Page No
Date

Stzing Stores charactex aay


chass Ciol;- StoTes cooTd

Structure Stoes detaied irnfoznatHon about


particulay object Ifke studeot, employee.

Uoicn Chion Cao be defined as usez-defioed


data-types ohich Stozes dfE data-types

enum Oeek) mon, The oeds Thuz,fai,sat

Void main )

epum Oeek day


day Thuz j
pzintf (u d,da);
getch ),

Constant i
# defoe pTeppceSSoY
2. using Const keyuoozd
defioe LENTH l0
cq’ de fineITH 5
Date

caps voidmain ()

aca WTDTH
LENTH *
areq=
printf Valu aTeas
getch ();

Const iot LENGTH - l0

Data-types
Bytes
datatypes
Short iot 2 Range
-32,768 ta 2 6
unsigne shosl in+
uDsíqnrd iot oto ,294S(1,25
T2147A23,64 tu
Iengint
unsigoedlong int to 42.GL,361,293
long iog int -2^63 to(243
Signed chaz
unsigned chaz -)231to27
float Oto 255
double 4
long double

you Can USe


Size of Size ofO opeator to Check
Vaiab|e
Page tNo.
Dato

keycorde - keyuords aze resezVed Coords


therc 32 keyor ds

auto , break ) Casechaz,Const,Continue ,


Ldefaut , do 2double ,clse ,eoum,CxteID}
float for, qoto , if, int,long,Teqiste ,

Tetun Shot, sign, sizcof ,stati


stuct soitch,typedef ,unfon, unsigoecd
Void Volatsie ohile
iot - d shozt i n t h d
loat
Jong
double- E unsiqned lonq int - 2.lu
char Zc lDDg double- 7. LE

unsiqned long - .lu


unsaned iot- 7.u
shozt-Zd

+iioclude x stdioh
Vord naio O
int a =|0 ;
cha b-ls';
floqt C=288 ,
double d 28.8883
pf("In Thteqer value - %cl');
b);
pf("lnchaaactex
pf flbat yalue
\nfloat Value -%{,c)3
pf (" o doubie float Value fd);

You might also like