This document outlines the topics and exercises covered in a 12-week computer programming lab. Over the course of the lab, students will learn programming concepts like variables, data types, input/output, conditional statements, loops, functions, arrays, strings, structures, pointers, files and recursion. Exercises include writing simple programs to calculate areas, interests, prime numbers, sorting, searching, matrix operations and more. The goal is for students to learn algorithms, syntax, debugging and data manipulation through hands-on programming practice.
This document outlines the topics and exercises covered in a 12-week computer programming lab. Over the course of the lab, students will learn programming concepts like variables, data types, input/output, conditional statements, loops, functions, arrays, strings, structures, pointers, files and recursion. Exercises include writing simple programs to calculate areas, interests, prime numbers, sorting, searching, matrix operations and more. The goal is for students to learn algorithms, syntax, debugging and data manipulation through hands-on programming practice.
WEEK Topics Exercises* 1 Familiarization with programming Write hello world program. environment, C Program Structure, Calculates the area of a circle. Input Output statements, Data types, Calculates simple interest. Simple computational problems Swap two numbers. using arithmetic expressions Converts Centigrade to Fahrenheit Takes hours and minutes as input, and calculates the total number of minutes. 2 Problems involving if-then-else, Determines largest of 2 numbers, 3 numbers. switch statements Determines whether a number is even or odd. Finds whether a year is a leap year Finds the roots of a quadratic equation. Implements a simple calculator 3 Problems involving loops Generates and Finds if the given number is a prime number, Determines whether a number is Armstrong number or not Sum of first n natural numbers Finds GCD, LCM of a given number Computes sum of series like 1!+2!+3!+..n! etc. 4 Problems involving nested loops Displays the multiplication table vertically from 1 to n. Displays Pascal’s triangle, diamond shaped pattern, pyramid Pattern etc. 5 Array manipulation: 1D array Performs Linear Search on a list of n elements. Finds largest, smallest element from a given list of elements Sorts a list of n elements in ascending/ descending order using bubble sort. 6 String operations Finds length of a string, String reversing, String comparison, Finds whether the given string is palindrome or not 7 2D Array manipulation Programs involving Matrix operations [ addition, multiplication] 8 Pointers: Demonstration the use of &(address of) and *(value at address) operator in a program. Storing n elements in an array and print them using pointer. Computing the sum of all elements in an array using pointers. 9 Functions: Programs involving Swapping two numbers, simple functions involving return Determining square and cube of a number using statement and no return statement functions. Determining number of vowels, consonants and special characters in a string. 10 Recursive functions Finding Factorial, Fibonacci series, Ackerman function etc. 11 Structures Arithmetic operations on Complex numbers, rational numbers, Operations on student records 12 File operations Programs using the concepts of file handling *These are suggestive exercises, depending on the requirement and availability of time the instructor can choose to do additional exercises. Laboratory Outcomes (i) To formulate the algorithms for simple problems (ii) To translate given algorithms to a working and correct program (iii) To be able to correct syntax errors as reported by the compilers (iv) To be able to identify and correct logical errors encountered at run time (v) To be able to write iterative as well as recursive programs (vi) To be able to represent data in arrays, strings and structures and manipulate them through a program (vii) To be able to create, read and write to and from simple text files.
Course Title: Computer Fundamentals and C Programming Course Level: PG Credit Units:05 Course Type: CSIT634 Course Objectives LTP/ S SW/ FW Total Credi T Units