Skip to content

Commit e5a017c

Browse files
authored
Update README.md
1 parent 06f7799 commit e5a017c

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed
Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
#SUM OF SQUARES OF ARRAY OF SIZE N
1+
# SUM OF SQUARES OF ARRAY OF SIZE N
22

3-
##Following steps are followed:
3+
## Following steps are followed:
44

5-
1. First, we take the size of the array as input (N).
5+
- First, we take the size of the array as input (N).
66

7-
2. Then, the array is declared to be of integer type.
7+
- Then, the array is declared to be of integer type.
88

9-
3. The space separated array elements are taken as input from user.
9+
- The space separated array elements are taken as input from user.
1010

11-
4. An integer type variable called *sum* is declared and initialised with value 0 as no array element is added yet.
11+
- An integer type variable called *sum* is declared and initialised with value 0 as no array element is added yet.
1212

13-
5. Now, a for loop is used to read each element starting from index 0 to N-1 and are simultaneously added to previous value of sum and array element present at that particular loop index is added two times.
13+
- Now, a for loop is used to read each element starting from index 0 to N-1 and are simultaneously added to previous value of sum and array element present at that particular loop index is added two times.
1414

15-
6. Lastly, the variable sum which contains the final answer is printed as the output.
15+
- Lastly, the variable sum which contains the final answer is printed as the output.
1616

1717
#HAPPYCODING ;)

0 commit comments

Comments
 (0)