CS01 Programming in C
Teaching Hours: 60 [30 hours Theory + 30 hours LAB]
Prerequisite: Knowledge about computers
Unit 1: Introduction to C
Types of Programming Language- History of C, Features of C , C Tokens, variables and keywords and identifiers ,Types of C constants and variables, Rules for constructing variable names, Structure of C program, Input /output statements in C
(6 hours)
Unit 2: Data types
Data Types, Type declaration, Different Operators in C - Arithmetic, Logical, Relational, Bitwise, Conditional, Expressions, Hierarchy of operations.
Control structures
Decision control statements-if, switch, go to statement, conditional operator statement. Loop control structures- while, do-while, for loop, Break statement, Continue statement.
(7 hours)
Unit 3: Function
Introduction, function definition and prototyping, Types of functions, passing values to function, recursion, passing arrays to functions. I/O functions- formatted & unformatted console I/O functions Storage classes in C- Automatic, Register, Extern and Static Variables.
(6 hours)
Unit 4: Arrays
One dimensional and multidimensional arrays, Declaration, initialization, Reading values into an array, Displaying array contents and Array Manipulations. String-Basic Concepts, Library Functions
(6 hours)
Unit 5: Pointers
Definition, notation, pointer and arrays, pointers and functions-call by value and call by reference.
(5 hours)
Text Book:
1. Balagurusamy, E. Programming in ANSI C 4th Edition. Tata McGraw-Hill
Reference:
1. Kanetkar, Yashavant. Let Us C. 4th Edition. BPB Publications.
C Programming Lab
Guidelines:
Article . Follow Coding standards
Article I. The output of the programs should be neatly formatted
Article II. The programs should be user friendly and interactive
Article III. Use comment wherever necessary
1. Aim: To demonstrate the usage of operators and data types in C
Write a program to print the size of all the data types supported by C and its range.
2. Aim: To demonstrate the usage of scanf and printf statements
Write a program to convert Fahrenheit to Celsius.
3. Aim: To demonstrate the usage of unformatted and formatted I/O statements in C
4. Aim: To demonstrate the usage of if, if-else
Write a program to check whether the given number is an even or odd
5. Aim: To demonstrate the concept of while, do-while, for loops, break and continue
i)write a program to print all prime numbers between any 2 given limits
ii)Write a program to print all the Armstrong numbers between any 2 given limits.
6. Aim: To demonstrate the concept of switch-case
a. Write a program to count the different vowels in a line of text.
7. Aim: To demonstrate the concept of function
Write a program to calculate the factorial of any given number
8. Aim: To demonstrate the concept of arrays
Write a program to check whether a string is a palindrome
9. Aim: To implement about pointers
Write a function to swap two numbers using pointers