8escs01 problem solving through programming unit-2: c programming basics



Download 0,98 Mb.
bet3/22
Sana19.05.2023
Hajmi0,98 Mb.
#940862
1   2   3   4   5   6   7   8   9   ...   22
Bog'liq
Module 2 c program

STRUCTURE OF A ‘C’ PROGRAM

STRUCTURE OF C PROGRAM


11
MANJUNATH C R

Documentation Section

Pre-processor Section

Definition Section

Global Declaration Section

main ( )
{
DECLERATION PART EXECUTION PART
}

Sub program section
{
Body of the sub program
}

STRUCTURE OF C PROGRAM


(i) Documentation section:
  • It consists of set of command lines used to specify the name of the program, the author of the program and other details etc.
  • Comments are very helpful in identifying the program features and underlying logic of the program.
  • The lines with ‘/*’ and ending with ‘*/’ are known as comment lines. These are not executable, the compiler is ignored anything in between /* and */.

  • (ii) Pre-processor section:
  • It is used to link system library files, for defining the macros and for defining the conditional inclusion.
  • Example: #include

  • (iii) Definition section:
  • The definition section defines all symbolic constants.
  • Example: #define pi 3.14

12

STRUCTURE OF C PROGRAM


(iv) Global Declaration Section:
  • The variable that are used in more than one function throughout the program are called global variable and are declared outside of all the function. Ie.m main( ) function.

  • (v) Main Function:
  • Every C program must have one main function, which specify the starting of C program.
  • Declaration Part: This part is used to declare all the variables that are used in the executable part of the program and these are called local variables.
  • Executable Part:
    • It contains at least one valid C statements.
    • The execution of a program begins with opening brace


Download 0,98 Mb.

Do'stlaringiz bilan baham:
1   2   3   4   5   6   7   8   9   ...   22




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish