Lab Assignment -4
(Week #7: Control Structures (2) – loop)
Program to input a number and then calculate sum of its digits.
(Hint: let number = 562.
Then you should print 5+6+2=13.
562%10=2
562/10=56 )
Write a program that displays all the numbers from 1 to 100 that are not divisible by 2 as well as by 3.
Do'stlaringiz bilan baham: |