C programming ppt slides, pdf on arrays



Download 0,84 Mb.
bet2/9
Sana25.09.2021
Hajmi0,84 Mb.
#185314
1   2   3   4   5   6   7   8   9
Bog'liq
algio

ARRAYS

  • Can you imagine how long we have to write the declaration part by using normal variable declaration?
    • int main(void)
    • {
      • int studMark1, studMark2, studMark3, studMark4, …, …, studMark998, stuMark999, studMark1000;
      • return 0;
    • }
  • www.tenouk.com, ©
  • 3/25

ARRAYS

  • By using an array, we just declare like this,
      • int  studMark[1000];
  • This will reserve 1000 contiguous memory locations for storing the students’ marks.
  • Graphically, this can be depicted as in the following figure.
  • www.tenouk.com, ©
  • 4/25

ARRAYS

  • This absolutely has simplified our declaration of the variables.
  • We can use index or subscript to identify each element or location in the memory.
  • Hence, if we have an index of jIndex, studMark[jIndex] would refer to the jIndexth element in the array of studMark.
  • For example, studMark[0] will refer to the first element of the array.
  • Thus by changing the value of jIndex, we could refer to any element in the array.
  • So, array has simplified our declaration and of course, manipulation of the data.
  • www.tenouk.com, ©
  • 5/25

Download 0,84 Mb.

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




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