You are on page 1of 1

Assignment

Introduction to Programming Lab


Submission Date: 6th Week Final class
Important Note: Please submit the assignment as a handwritten copy.
Add a cover page on top to write your Name, Id, Section, etc.
1. Write the definition for the following question with proper example(s)
a. Compiler
b. Data type
c. Type casting
d. Switch
e. Case
f. Break
g. Continue
2. How does a loop work? Describe all types of loops with proper examples.
What are the differences between each loop?
3. What is an array? Explain how data is distributed inside an array with a
proper example.
4. Write a program that calculates the sum of the first n terms of the series 1 +
1/4 + 1/9 + ... + 1/n^2. The program should ask the user to enter the value of
n, and then use a loop to calculate the sum.
5. Develop a program where you can take both integer and float numbers as
array values. Now show the addition operation for each element of the array.
6. Write a program that will have an array with N integer elements, and we
have to replace the given element with 0 from the array using a program.
(You need to take which element you want to delete by taking user input.

You might also like