Sei sulla pagina 1di 2

Student Regd.

No
E
COURSE CODE: DCAP102
COURSE TITLE: Basic Programming Skills

Time Allowed: 3 hours Max. Marks: 80


1. This paper contains 10 questions divided in two parts on 2 pages.
2. Part A is compulsory.
3. In Part B (Questions 2 to 10), attempt any 6 questions out of 9. Attempt all
parts of the questions chosen.
4. The marks assigned to each question are shown at the end of each question in
square brackets.
5. Answer all questions in serial order.

PART-A

Q1. Define the following terms:

a) Variable
b) Loop
c) Constant
d) Keyword
e) Logical error
f) Operator
g) String
h) File
i) Pointer
j) Iteration [2*10=20]

PART-B

Q2. Write a program to get a value from user and decide whether the number entered by
user is even or odd? And also calculate the square of the number? [10]

Q3.
a) Write a program to find the greatest among three numbers using if-else statement.
b) Write a program to decide whether the number entered by user is positive or negative.
[5*2=10]

Q4. What do you mean by array, how arrays are helpful, write a program to read 12 numbers
from user, sum all the numbers entered by user and print the sum as the result. [10]

Q5. Write the advantages of structures. Create a structure for storing student record, read a
student record from user with the help of the structure variable and print the stored record to
user. [10]
Q6. Why the pointers are so important? Prove the usefulness of pointers with the help of an
example? Create a pointer variable and print the content (address of variable where the
pointer is pointing) of the pointer variable. [10]

Q7. Is there any method to carry the effect of changes made inside function to main
program? If yes, write an example to show the same. If not, then suggest an alternate for
getting effect in main program. [10]

Q8.

a) Write a program to print first 10 even numbers using for loop


b) Write a program to check whether a number is prime or not
[5*2=10]

Q9. Write a program to accept a string as input and test whether user entered string is
palindrome or not? [10]

Q10. Why we need the different storage classes? Discuss all the storage classes, also write
a program to use any storage class other than ‘auto’. [10]

-- End of Question Paper --

Potrebbero piacerti anche