Tuesday, January 22, 2019

2sem phy n ele- complementary cs

2C02CSC Programming in C 

Contact Hours per Week : 2 Theory Credit : 2

 Module I 
          Importance of C; Basic structure of C, Executing a C program- Character set - C tokens, Keywords, Identifiers, Constants, Data types, Declaration of variables, Operators. Precedence and order of evaluation. 

Module II 
          Managing Input output operation: reading a character, writing a character, formatted input output. Branching statements-if, if..else, nested if...else, else...if ladder, switch statement, go to statement. Looping statements- while, do...while, for loop. Break and continue statements. 

Module III 
            Arrays: Introduction to Arrays - One Dimensional Array - Strings Two Dimensional Array - Multi- dimensional Array. Strings: Basic concepts, standard library string functions- strlen, strcpy, strcmp, strcat & strrev. Two dimensional arrays of strings 

Module IV 
             Functions: Introduction to Functions, Function Declaration and Prototypes- call by value and call by reference- , Storage Classes - Recursion. Pointers: Introduction to Pointers, Pointer Notation, Pointer Declaration and Initialization, Accessing Variable through Pointer 

Module V 
           Structures and Unions: Structure Definition, Structure Initialization, Arrays of Structures, Arrays within Structures, Structures within Structures, Union–Definition and Declaration, Accessing a Union Member, Initialization of a Union Variable. 

Text Book : 

1. ANSI C, E. Balagurusamy, 3rd edition McGraw-Hill Publication 
2. Computer Basics and C Programming, V. Rajaraman, PHI, 2008 95 
3. Programming with ANSI and Turbo C, Ashok N. Kamthane, 1st edn, Pearson Education 
4. Let us C, Yashavant Kanetkar, BPB Publications 

Reference books

1. Computer Fundamentals and Programming in C, AnitaGoel, Ajay Mittal, Pearson Education 
2. Deitel, H M and Deitel P J: “C How to Program”, 2nd Edition. Prentice-Hall 
3. Gottfried, Byron S: “Programming with C”, 1996. Tata McGraw-Hill 

Model Question Paper 

Time: 3 Hrs Max. Marks: 32 

SECTION A 
1. One word answer (6 x 0.5 = 3 marks) 

a. For a character function, we must include the header file ….. in the program 
b. Maximum number of elements in the array declaration int a[5][8] is….. 
c. A function that calls itself is called …… 
d. A pointer hold …….. 
e. A function malloc() is used for…….. 
f. The mode ….is used for opening a file for updating 

SECTION B 
Write short notes on ANY FIVE of the following questions (5x 2 = 10 marks) 

2. What is recursive function? 
3. Explain any three string functions 
4. Explain variable access through pointer.  
5. What is the syntax of a structure? 
6. Write syntax of for loop. 
7. What is function proto type? 
8. Define an Array. 
9. Give suitable examples for array of structures and array within structure. 

SECTION C
Answer ANY THREE of the following questions (3 x 3 = 9 marks) 

10. What are the differences between structure and union 
11. What is a string? Write a simple c program using string function. 
12. What is the difference between entry controlled and exit controlled loops? 
13. Explain call by value and call by reference. 
14. What is meant by storage class? Explain. 

SECTION D 
Write an essay on ANY TWO of the following questions (2 x 5 = 10 marks) 

15. Explain the working of a switch statement with example. 
16. What are the advantages of using functions? What are the different methods to pass arguments to functions? 
17. Write a program to read two matrices and find its product. 
18. Write a simple c program for structure and union.

Previous Question Paper






One word questions 




Lab programs