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


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

<="" p="">b=a*3 print(a<=b/3) input()
<="" p="" >
a=8 b=a
c=(a+b==2*b) print(c) input()
a=8 b=a-4
print((a+3)>=(b-2))
input()
#3.Mantiqiy ifodalar natijasini toping: a = 20
c = False
d=a > 17 or c print(d) input()
a = 20
c = False

d=not a > 17 or not c print(d)


#2.Mantiqiy ifodalar qiymatini aniqlang: a=(1 > 3) or (4 < 0)

b=not (5 > 6) print(b) c=not (6 > 5) print(c)

d=(2 == 0) or (2 != 2)
print(d)
e=(2 == 0) and (2 > 0)
print(e)
f=(3 > 0) or (2 > 0)
print(f)
a = True b = True c = False

d=(not(a and c) and (a or b) or c) print(d)
a = 66
b = 22
c = 7
d=not((a > b) or (b < c)) print(d)

#4.Mantiqiy ifodalar qiymatini aniqlash uchun #dastur tuzing va natijasini oling: a=int(input("a="))


b=(a<=5 or a>=0 and a<3) print(b)
input() a=int(input("a="))
b=int(input("b="))
c=int(input("c="))
x=int(input("x="))
y=int(input("y="))
d=(x**2+y>0 and a==0.1 or (b>3.7 and c!=4))
print(d) input()
a=int(input("a="))
b=int(input("b="))
s=(a<1 or a>0 or not (x*x+x*x<=1)) print(s)
input()
d=not(not(not(a>b) or True) and False) print(d)

46-DARS

#1.Ikkita a va b son berilgan. Agar b son a sondan #kichik bo‘lsa, u holda b ni nol bilan almashtiruvchi, #aks holda b ni o‘zgarishsiz qoldiruvchi dastur tuzing. #46-dars 1-topshiriq
a=int(input('a='))
b=int(input('b=')) if a
b=0 print('b=',b) input()
#46-dars 2-topshiriq

#2.Berilgan a butun son noldan farqli b butun songa

#qoldiqsiz bo‘linishi yoki bo‘linmasligini aniqlovchi #dastur tuzing.

a=int(input('a='))
b=int(input('b=')) c=a%b
if c==0:

print(a, ' soni', b, ' soniga qoldiqsiz bo`linadi') else:

print(a, ' soni', b, ' soniga qoldiqsiz bo`linmaydi') input()

#46-dars 3-topshiriq

#3.Berilgan a butun son noldan farqli b butun songa #qoldiqsiz bo‘linsa, bu ikkala sonning yig‘indisini, #aks holda ko‘paytmasini topish dasturini tuzing. a=int(input('a='))
b=int(input('b=')) c=a%b
if c==0:

d=a+b else:

d=a*b print(d)
input()
#46-dars 4-topshiriq

#4.Uchta a, b va c son berilgan. Agar a2 – b2 = c2 #shart bajarilsa, ularning ko‘paytmasini, aks holda #yig‘indisini hisoblovchi dastur tuzing.
a=int(input('a='))

b=int(input('b='))
c=int(input('c=')) if a*a-b*b==c*c:
p=a*b*c print(p)
else:
s=a+b+c print(s)

input()


#46-dars 5-topshiriq
# 5.Butun son berilgan. Agar u musbat bo‘lsa, unga 1 #sonini qo‘shish, aks holda o‘zini chiqarish dasturini tuzing.
a=int(input('a=')) if a>0:

a=a+1 print('a=',a)
input
#46-dars 6-topshiriq
#6.Kiritilgan butun son musbat bo‘lsa, uning 10 ga ko‘paytmasini, #aks holda o‘zini chiqaruvchi dastur tuzing.

a=int(input('a=')) if a>0:
a=a*10 else:
a=a print('a=',a)

# 47-dars. TARMOQLANUVCHI ALGORITMLARNI DASTURLASH. #ELIF OPERATORI

#1. Ikki xonali sonning raqamlari toq #ekanligini aniqlovchi dastur tuzing.
#47-dars 1-misol a=int(input('bi=')) b=a//10
i=a%10

if b%2!=0 and i%2!=0: print('raqamlar toq',b,':',i)

else:

print(' raqamlar toq emas',b,':',i)


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