0% found this document useful (0 votes)
27 views

CP

Uploaded by

anubavroshan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
27 views

CP

Uploaded by

anubavroshan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

PONDICHERRY ENGINEERING COLLEGE, PUDUCHERRY

B.TECH DEGREE EXAMINATION – Nov / Dec 2020


Common for ALL Branches

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?

iv. What is pointer to pointer?


v. State the use of rewind( ) with syntax.
Part B - Answer ANY FIVE Questions ONLY 5 x 8 =40 Marks
No Question Marks
1. a. Discuss about the various generations of programming languages 4
b. Explain in detail about Working Principle of Computer with diagram. 4

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”

3. a. Explain the various types of branching statements in C with examples 4


b. Write a C program to print the prime numbers from 1 to 100 4

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

7. a. What are the features of pointers? Explain different arithmetic operations


on pointers with examples. 4

b. Write a C program to show that pointer of any data type occupies same
4
space

8 a. Write a C program that defines a structure Employee containing the details


such as Emp id, Emp name, Department name and salary. The structure has
8
to store 10 employees in an organization. Print the name of the employee
who gets maximum salary.

9. a. Write a C language program to read “Grade.dat” file containing Student


Rollno, name, grades of five subjects and calculate total GPA, result in 8
CGPA and store the same in “Result.dat” file

10 a. What do you mean by pre-processor directives? Explain macro inclusion


4
directives with proper examples.
b. Explain the working of dynamic memory allocation with suitable
4
commands and syntax
Part C ( Answer any ONE only ) 1 x 10 =10 Marks

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”).

12. a. Write a C Program to get n x m matrix. Perform the following


i) Find the sum of odd elements and even elements 10
ii) Find the second smallest and second largest matrix element
iii) Find the sum of diagonal elements

You might also like