Programming For Problem Solving Using C Lab (20-21)
Programming For Problem Solving Using C Lab (20-21)
Course Outcomes: At the end of the Course the student shall be able to
CO1: apply the concepts of variables, data types, operators and expressions.(L3)
CO2: demonstrate the usage of Conditional and Unconditional statements. (L3)
CO3: demonstrate the usage of functions and relate functions with respect to arrays and strings.
(L3)
CO4: implement the concept of pointers and structures. (L3)
CO5: demonstrate the usage of files and Command Line Arguments. (L3)
1. Basic Programs
A. C program to display hello world message.
B. C program to scan all data type variables as input and print it as output.
C. C program to perform arithmetic operations like +,-,*,/,% on two input variables.
D. C program to perform temperature conversions from Centigrade to Fahrenheit and vice versa.
2. Programs on Operators
A. C program to scan an input and perform pre and post increment operation on it and display the
result.
B. C program to perform all bit wise operations.
C. C program to extract the last two digits of a given integer n, where the number of digits
should be greater than 2.
D. C program to display the greatest of three numbers using a conditional operator.
E. C program to swap two numbers without using a third variable.
5. Programs on Functions
A. C program to demonstrate the various categories of functions with respect to return type and
number of arguments.
B. C program to find the LCM of two numbers using functions.
C. Create a header file which contains the following prototype:
i. int factorial(int) ; // non-recursive function
ii. int factorial_rec(int); //Recursive function
iii. int prime(int);
Use the above functions in a C program by including the above header file. D.
C program to display Pascal’s triangle using functions.
6. Programs on Arrays
A. C program to read n integer values into an array and display them
B. C program to count and display the number of positive, negative, even and odd numbers in a
given array of integers and also display their sum.
C. C program to find the smallest and largest numbers in an array of integers.
D. C program to perform addition, multiplication, transpose of given matrices using functions.
E. C program to check whether a given integer exists in a list of numbers and print its index
value if it is present, otherwise print “No”.
7. Programs on Strings
A. C program to convert upper case character to lowercase and vice versa in a given string.
B. C program to delete all vowels in a given string and display the remaining string.
C. C program to check whether a given string is palindrome or not.
D. C program that reads two integers as strings and displays their sum.
8. Programs on Strings
A. C program to demonstrate the usage of at least 10 predefined string handling
functions.
B. C program that implements the following user defined string handling functions
i. To find the length of the given string
ii. To copy the contents of one string to another
iii. To reverse the contents of a string
iv. To compare two strings
v. To concatenate two strings
13. C program to replace all the vowels in a given string with a given character
15. C program that writes the contents to a file and reads the contents from a file using structures.
Reference Books:
1. Ashok N Kamthane, Amit Ashok Kamthane, Programming in C, 3rd Edition, Pearson
Publication 2015.
2. Herbert Schildt, The Complete Reference C, 4th Edition,Tata McGraw-Hill, 2017.
3. Brian W. Kernighan and Dennis M. Ritchie, The C Programming Language, 2nd Edition,
Prentice-Hall, 2015.
4. Rajaraman V, The Fundamentals of Computer, 6th Edition, Prentice-Hall of India, 2014.
5. Steve Oualline, Practical C Programming, 3rd Edition, O’Reilly Press, 2006.
6. Balagurusamy E, Programming in ANSI C, 8th Edition, Tata McGraw-Hill, 2019.
7. Gottfried, Programming with C, 3rd Edition, Tata McGraw-Hill, 2018.
Web References:
1. https://onlinecourses.nptel.ac.in/noc19_cs42/preview
2. https://www.programiz.com/c-programming