Respuesta :

Not sure what programming language, but i'll use Java

print (1)
print (2)
print (3)
print (4)
print (5)
print (6)
print (7)
print (8)
print (9)
print (10)
print (11)
print (12)
print (13)
print (14)
print (15)
Another way to think about this is through the use of a loop, since printing a number is a very repetitive task, you could also use,

number = 1
while number < 16:
      print(number)
      number = number + 1

The logic behind this is the "while" loop would check whether the variable 'number' is less than 16 (i.e. between 1 and 15) if so, it prints the number and then adds one to it. It then repeats the check over and over until 16 is reached and then the program terminates.

Otras preguntas