Computer Science, asked by singhakansha445, 6 months ago

write a program based on looping statement.​

Answers

Answered by jai696
3

\huge\red{\mid{\fbox{\tt{Using\: Python\: 3}}\mid}}

def increment(salary):

salaries = []

new_salary = salary

for _ in range(5):

new_salary *= 1.1

salaries.append(round(new_salary, 2))

return "\n".join([f"Year {idx + 1}: {salary}" for idx, salary in enumerate(salaries)])

print(increment((salary := float(input("salary: ")))))

You didn't mention what the program should do, so I added this program which uses a for loop.

\large\mathsf\color{lightgreen}useful?\: \color{white}\longrightarrow\: \color{orange}brainliest!

Answered by shripoorna82
4

Answer:

#include < stdio . h >

#include <conio . h >

int main ( )

{

int num=1 ; / / i

nitializing the variable

while ( num <=10 ) / /w

hile loop with condition

{

print f ( "%d \ n ", num );

num ++;

/ / incrementing operation

}

return 0 ;

}

Output:

1

2

3

4

5

6

7

8

9

10

Similar questions