Concept:For an arithmetic progression, when the first term a and last term l are known, the sum is Sn=2n(a+l).Explanation:Given first term a=6, last term l=10, and sum Sn=40.Substitute into the formula: 40=2n(6+10).Simplify inside the bracket: 40=2n×16.So 40=8n.Divide both sides by 8: n=840=5.Answer:The number of terms is n=5.