Darvozaning eni metr, bo‘yi esa metr: #1) darvoza yuzasi (S)ni hisoblash dasturini tuzing


Download 40.09 Kb.
bet5/10
Sana30.04.2023
Hajmi40.09 Kb.
#1408293
1   2   3   4   5   6   7   8   9   10
Bog'liq
9-sinf inf


a=int(input('a='))

b=int(input('b=')) c=a+b
if a>0 and b>0 and c>100: s=a/b
if a>0 and b>0 and c<=100: s=a*b
print(s) input()
#48-dars 8-mashq

#8.Ikkita son berilgan. Agar birinchi son ikkinchisidan katta #bo‘lsa, 1 ni, agar ikkinchi son birinchisidan katta bo‘lsa,
#2 ni, agar ikkalasi teng bo‘lsa, 0 ni chiqaruvchi dastur tuzing.
a=int(input('a='))

b=int(input('b=')) if a>b:
print(a) if b>a:
print(b) if a==b:
print(0)
#49–50-darslar. TAKRORLANUVCHI ALGORITMLARNI DASTURLASH. #FOR OPERATORI

#49-dars 1-topshiriq

#1.a va b sonlar berilgan. a dan b gacha bо‘lgan barcha #sonlarni chiqaruvchi dastur tuzing. Bu yerda a <= b.

print('a<=b shartni bajaruvchi a va b sonlarini kiriting ') a=int(input('a='))

b=int(input('b=')) if a>b:
print('xato kiritdingiz') else:
for i in range(a,b+1): print(i, end=':')
input()
#49-dars 2-topshiriq

#2.a va b sonlar berilgan. Agar a < b bо‘lsa, a dan b gacha #bо‘lgan sonlarni о‘sish tartibida, aks holda kamayish #tartibida chiqaring.

a=int(input('a='))

b=int(input('b=')) if a
for i in range(b,a-1,-1):
print(i, end=':') if a>=b:
for i in range(a,b-1,-1):
print(i, end=':') input()

#49-dars 3-topshiriq

#3.1 dan 10 gacha bо‘lgan natural sonlar kvadratlarini #chiqaruvchi dastur tuzing.

for i in range(1,11): print(i,'ni kvadrati',i*i)

input()

#49-dars 4-topshiriq

#4.1 dan 10 gacha bо‘lgan natural sonlar yig‘indisini #chiqaruvchi dastur tuzing.

i=1;s=0

for i in range(11):
s=s+i print('s=',s)
#51-dars. AMALIY MASHG‘ULOT


Download 40.09 Kb.

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




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