Computer Science, asked by muskanagrawal9912, 21 days ago

Algorithm to print all natural numbers up to 10

Answers

Answered by AdityaSingh2746
0

Answer:

Explanation:

JavaScript

for(i = 1; i <= 10; i++){

console.log(i)

}

C

for(i = 1; i <= 10; i++){

  printf("%d", i)

}

Python

for i in range(10){

print(i)

}

Java

for(i = 1; i <= 10; i++){

  System.out.println(i)

}

In CPP also it will be same except for printing

Similar questions