Ask Question

Name:
Title:
Your Question:

Answer Question

Name:
Your Answer:
User Submitted Source Code!


Description:
  Dim A(1 To 10) As Integer X = 0 For K = 1 to 10 X = X + A(K) Next K X = X / 10 Y = 0 For K = 1 to 10 If Abs(A(K) – X) < 3 Then Y = Y + A(K) End If Next K Print Y
Language: BASIC
Code:
Dim A(1 To 10) As Integer 
X = 0 
For K = 1 to 10 
 X = X + A(K) 
Next K 
X = X / 10 
Y = 0 
For K = 1 to 10 
 If Abs(A(K) – X) < 3 Then 
 Y = Y + A(K) 
 End If 
Next K 
Print Y 
          
Comments: