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



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

29

CONSTANTS –NUMERIC CONSTANTS


(ii) Real Constants:
  • Real Constants are often known as floating point constants.
  • Real Constants can be represented in exponential form or floating point form.
  • Rules for constructing real constants are:
    • A real constant must have at least one digit.
    • It must have a decimal point.
    • It could be either positive or negative.
    • Default sign is positive.
    • No commas or blanks are allowed within a real constant.
  • Examples of valid real constants:

  • +325.34, 426.0, -32.76, -48.456 etc.

(i) Single Character Constants:

  • A character constant is a single alphabet, a single digit or a single special symbol enclosed within single inverted commas (‘ ’).
  • The maximum length of a character constant can be 1 character.
  • Example: ‘A’, ‘I’, ‘5’, etc.

  • (ii) String Character Constants:
  • String Constants are sequence of characters within double quote marks (“ ”).
  • The string may be combination of all kinds of symbols.
  • Example: “Hello”, “India”, “444”, “a” etc.

CONSTANTS – CHARACTER CONSTANTS

(IV) DATA TYPE

  • Data type is the type of data going to be process within the program.
  • C supports different data types have predefined Memory requirement.
  • Generally data is represented using numbers or character.

(IV) DATA TYPE

DATA TYPE – INTEGER DATA TYPE


(i) Short Integer:
oIt occupies 2 bytes of memory. oRange is from -32768 to 32767. oProgram runs faster.
oFormat specifier is %d or %c.
oExample: int a=2;
short int a=3
(iii) Signed Integer:
oIt occupies 2 bytes of memory . oRange -32768 to 32767 . oFormat specifier is %d or %c. oLong signed integer occupies 4 bytes of memory.
oExample: signed int a=-2;

Download 0,98 Mb.

Do'stlaringiz bilan baham:
1   ...   4   5   6   7   8   9   10   11   ...   22




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©www.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