Professional Documents
Culture Documents
Cpe 311 Assignment
Cpe 311 Assignment
Question 1
(1A). Write a program to print out the sum of the first 400 [positive integers.
CODE:
RESULT:
(1B). Also see how to write the program without using a loop.
CODE:
RESULT:
(2A). Write a program to print a list containing counting numbers from 2 to 50.
CODE:
RESULT:
(2B). Write a program to print integers from 1 to 7 all in one line.
CODE:
RESULT:
QUESTION 3:
(3A). Write a program to print numbers between 60 and 400 that are both
divisible by 3 and 4.
CODE:
RESULT:
CODE:
RESULT:
QUESTION 4:
CODE:
RESULT:
CODE:
RESULT: