write a program to calculate sum of 1 to 10 numbers using while ?
Answers
Answered by
0
Answer:
Pictorial Presentation:
Sample Solution:
C Code: #include <stdio.h> void main() { int j, sum = 0; printf("The first 10 natural number is :\n"); for (j = 1; j <= 10; j++) { sum = sum + j; printf("%d ",j); } printf("\nThe Sum is : %d\n", sum); } ...
Flowchart:
please follow me Mark brainlest
Answered by
0
Answer:
55
Explanation:
java programming:
public class Sum{
public static void main ( String[] args){
int num = 10, i = 1, sum = 0;
while( i <= num)
{
sum += i;
i++;
}
System.out.println( sum);
}
}
Similar questions