CP
CP
I/IISEMESTER
CS201- Programming for Problem Solving
Time: Three Hours Max. Marks: 60
Part A - Answer ALL Questions. 5 x 2 = 10 Marks
No. Question
i. Write the steps involved in Program Development Lifecycle.
ii. What is the use of sizeof( ) operator in C?
iii. Differentiate scanf( ) and gets( ) function?
2. a. 4
Discuss about the types of Hardware and Software
b. 4
Write an algorithm, flowchart to find the sum of numbers from 1 to “n”
4. a. Write a C program using recursive function to find the sum of all digits of
4
the number. Example : input = 2635 expected output = 2+6+3+5=16
b. Write a program to display the following pattern
1
12
4
123
1234
12345
5. a. Write the difference between call by value and call by reference. Explain 4
with example
b. Write a C program to check whether the input string is palindrome or not 4
without using string inbuilt function.
6. a. Write a C program to get ‘n’ names in an array and print the largest name. 4
b. Explain any four string inbuilt functions with syntax and example 4
b. Write a C program to show that pointer of any data type occupies same
4
space
No Question Marks
11. a. Write a C program to give the input number and find a largest digit in a 10
given number and print it in word with appropriate message.
(e.g. input =6283 expected output = “EIGHT is largest”).