Computer Science, asked by arghya1445, 5 months ago

Write a program in qbasic to display the sum of first 10 natural numbers

Answers

Answered by kanchan292006
2

Answer:

public class ABC

{

public static void main(String[ ]args)

{

int sum=0;

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

{

sum=sum+i;

}

System.out.println("SUM OF FIRST TEN NATURAL NUMBERS"+sum);

}

}

Similar questions