Microsoft Small Basic

Program Listing: KFV334
TextWindow.Write("Scrieţi un număr: ")
n=TextWindow.ReadNumber()
nrest=n
nnou=0
cate=0
suma=0
While (nrest>0)
cifra=Math.Remainder(nrest,10)
suma=suma+cifra
nrest=Math.Floor(nrest/10)
If Math.Remainder(cifra,2)=0 Then
nnou=nnou+cifra*Math.Power(10,cate)
cate=cate+1
EndIf
EndWhile
TextWindow.WriteLine("Numărul nou este: "+nnou)
TextWindow.WriteLine("Suma cifrelor este: "+suma)