Computer Science, asked by shanejamin1, 1 day ago

plz tell all the programs fastly ​

Attachments:

Answers

Answered by agamsharanbhagat
1

Answer:

(1 ) 30

( 2) 5

(3) 9

Explanation:

hope its helpful you

Answered by anindyaadhikari13
7

Solution 1:

→ To print odd numbers between 25 and 45 using FOR loop.

for i in range(25+1,45):

   if i%2==1:

       print(i)

Logic:

  • Loop through the numbers in the range (26, 45).
  • Check if the number is odd or not.
  • If odd, display the number.

Solution 2:

→ To print the numbers from 1 to 20 using while loop.

i=1

while i<=20:

   print(i)

   i+=1

Logic:

  • Initialise i = 1
  • Loop while i <= 20.
  • Display the value of i.
  • Increment the value of 'i' by 1.

Solution 3:

→ To print the squares of the given numbers in a range (2, 10)

num_range=range(2, 10)

for i in num_range:

   print(i * i)

Logic:

  • Initialise the range [num_range = range(2, 10)
  • Loop through the numbers in the range.
  • Display the square of the numbers in the range.

See the attachments for output.

Attachments:

anindyaadhikari13: Thanks for the brainliest :)
Similar questions