11
Masalani echish algoritmini tuzish:
1. Yozma shaklda ;
2. Blok-sxema shaklida(1-rasm).
Algoritm matni:
1. O‟zgaruvchilarni kiritish(N);
2. S ning boshlang‟ich qiymatini berish (S=0);
3. i ning boshlang‟ich qiymatini berish (i=0);
4. Sikl boshi
1. S ga ketma-ket 0 dan Ngacha bo‟lgan sonlarni qo‟shish (S=S+i);
2. i ni qiymatini 1 ga oshirish (i=i+1);
3. i<=N shartni tekshirish
4. Agar shart bajarilsa , sikl boshiga o‟tish;
5. Aks holda Natijani olish (S);
6. Tamom.