You are on page 1of 1

cs101PracticeQuestionsinvolvingvariableupdatesusing

expressions

Wehavelearntvariableupdatesinvolvingexpressionsinthisweek(eg.
redefiningavariablesnewvalueintermsofitselfcomputedusingan
expression).Wewillhaveagradedlabnextweekinvolvingthese
concepts.Sincewehaventconductedanungradedlabfortheseconcepts,
hereareacoupleofpracticequestionsthatyoucantryonPrutor.

1.Drawspiralasshowninfigurebelow.

2.
Findthesumoftheexpressionoftheform

n*1k

+(n1)*2k

+..+1*nk

andprintitastheoutput.Takenandkastheinput.

You might also like