Sum of numbers, Factorial, and LCM

javascript dev.to

1)Sum of first n numbers Flowchart Python sum = 0 no = 1 while no 10: sum = sum + no no = no + 1 print("Sum =", sum) Output Javascript let sum = 0; let no = 1; while (no 10) { sum = sum + no; no = no + 1; } console.log("Sum =", sum); Java public class SumOfNumbers { public static void main(String[] args) { int sum = 0; int no = 1; while (no 10) { sum = sum + no; no = no + 1;

Read Full Tutorial open_in_new
arrow_back Back to Tutorials