Swami Keshvanand Institute of Technology Management &Gramothan, Jaipur
Course Title: 1FY3-24/2FY3-24:Computer Programming Lab
Class: I/IISemester B.Tech Exam Timings: 3 Hours
Scheduled Lab per Week: 3 Hours Max. Marks: 100(1A: 60, ETE: 40)
S.No. Computer Lab Assignment
Lab Assignment-1(Basic C programs )
Structure ofC Program, learn about the C library, Preprocessor directive, Input-Output statements, Data types,
and Tokens in C Programming.
P.l Write a program to print "HELL0 message.
P.2 Write a program to add any two numbers.
P.3 Write a program to find the area ofa triangle.
P.4 Write a program to convert temperature from Celsius to Fahrenheit.
P.5 Write a program to find area and circumference ofa circle.
Lab Assignment-2 ( Types of Operators )
Different types of operator Arithmetic, Relational, Logical, Increment/Decrement, Conditional, comma, Bitwise
and sizeof) operator.
P.6 Write a program to demonstrate the working of arithmetic operators.
P.7 Write a program to demonstrate the working of relational operators.
P.8 Write a program to demonstrate the working of logical operators.
P.9 Write a program to demonstrate the working of increment / decrement operators.
P.10 Write a program to find largest among three numbers using conditional/ternary operator.
Lab Assignment-3 (Conditional Statements)
Various conditional statements of ifelse, nested if-else, if-else-if (ladder) and switch case statements.
P.II Write a program to check whether a number is odd or even.
P.12 Write a program to check a given character is alphabet or not.
P.13 Write a programn to check a given number is positive, negative or zero.
Sunday.
P.14 Write a program using switch case statement to display from Monday to
+, -,*, 7, %).
P.15 Write a program to perform arithmetic operations using switch case (Mini Calculator using
Lab Assignment-4 ( Looping Statements )
Iterative statements like while, do-while, for loop, continue and break statements.
P.16 Write a program to display first 10 natural numbers and display their sum.
P.17 Write a program to print table of a number using for loop.
P.18 Write a program to find whether number is prime number or not.
P.19 Write a program to find reverse ofa given number.
P.20 Write a program to find factorial of given number
P.21 Write a program to print fibonacci series up to n terms.
Vin)
Swami Keshvanand Institute of Technology Management &Gramothan, Jaipur
Course Title: IFY3-24/2FY3-24: Computer Programming Lab
Class: I/II Semester B.Tech Exam Timings: 3 Hours
Scheduled Lab per Week: 3 Hours Max. Marks: 100(1A: 60, ETE: 40)
S.No. Lab Assignment-S (Pattern based problem using Nested loop)
Nested for loop, nested while loop and different kind of patterns.
P.22 Write a program to print half pyramid using * symbol.
P.23 Write a program to print half pyramid using numbers.
P.24 Write a program to print half pyramid using alphabets.
P.25 Write a program to print full pyramid using * symbol.
P.26 Write aprogram to print full pyramid using numbers.
Lab Assignment-6 (Array )
Array, types of array- one dimensional and wo dimensional(matrix) array and perform operations on array like
searching, sorting, transpose, multiplication etc.
P.27 Write a program to calculate sum and average of 10elements of given Array.
P.28 Write a program to find the maximum no in the Array.
P.29 Write a program to sort Array elements in ascending /descending order.
P.30 Write a program to search a specified element in the Array.
P.31 Write a program to insert an element at specified position in the Array.
P.32 Write a program to delete an element at specified position in the Array.
P.33 Write a program to input and output 2-D Array elements.
P.34 Write a program for addition of two matrices.
P.35 Write a program for subtraction of two matrices.
P.36 Write a program for multiplication of two matrices.
P.37 Write a program for transpose of a matrix.
Lab Assignment-7 ( Functions and Recursion)
Types ofunctions and types ef user-definedfunctions , parameter passing by value and recursion process.
P.38 Write a program to find diameter, circumference and area of circle using function.
P.39 Write a program to find maximum and minimum between two numbers using function.
P.40 Write a program to find prime numbers between a given ranges using function.
P.41 Write a program to find factorial of a number using recursion.
P.42 Write a program to find sum ofn Natural Numbers using recursion.
P.43 Write aprogram to calculate power of a number using recursion.
P.44 Write a program to find reverse of a number using recursion.
P.45 Write a program to find factorial ofa number using recursion.
vinij
Swami Keshvanand Institute of TechnologyManagement & Gramothan, Jaipur
Course Title: 1FY3-24/2FY3-24: Computer Programming Lab
Class: I/II Semester B.Tech Exam Timings: 3 Hours
Scheduled Lab per Week:3Hours Max. Marks: 100(1A: 60, ETE: 40)
Lab Assignment-8 (String and Character Array )
String declaration, initialization, diferent operations on string like copy, concatenate, reverse ,length, and
comparison etc. using string function and without using string function.
P.46 Write a program using string functions- strlen), strlwr(0, strupr), strev().
P.47 Write a program using string functions- strcat(), strcpy(), strcmp().
P.48 Write a program to find total number of alphabets, digits or special characters in a string.
P.49 Write a program to find the frequency of a given character.
P.50 Write a program to find an entered string is palindrome or not without using string functions.
P.S1 Write a program to sort words in lexicographical(dictionary) order.
Lab Assignment-9 (Pointers )
Pointers, arithmetic operations on pointers, pointer with array, pointer with string, pointer topointer.
P.52 Write a program to create, initialize and use of pointers.
P.53 Write a program to perform all arithmetic operations using pointers.
P.54 Write a program to swap two numbers using call by references.
P.55 Write a program to find length of a string using pointers.
P.56 Write a program tocount vowels and consonants in a string using pointers.
P.57 Write a program to input and print array elements using pointer.
P.58 Write a program to use the concept of double pointers (Pointers to Pointers).
Lab Assignment-10 (Structure and Union)
Structure, declaration of structure, initialization, structure pointer, array of structure, coping structure, passing
structure tothe user defined functions, nested structure, and differentiate structure and union.
P.59 Write a Cprogram to add two distances entered by user. Measurement of distance should be in inch and feet. (Note: 12 inches
= ]foot)
P.60 Write a program to read and display information of atleast 5 students.
P.61 Write aprogram to read and display information of book using pointer.
P.62 Write a program to read and display information of an employee by passing structure to a function.
P.63 Write a program to copy one structure into another.
P.64 Write a program to use the concept of nested structure.
P.65 Writea program to read and display information of a person using union.
Lab Assignment-11 (File Handling )
File creation, types offle, modes offile (r, w, a, rt, wt, at), different operation on file reading, writing, and
appending, copying one file to another.
P.66 Write a program to read text from a file.
ix)
Swami Keshvanand Institute of Technology Management & Gramothan, Jaipur
Course Title: IFY3-24/2FY3-24: Computer Programming Lab
Class: I/ISemester B.Tech Exam Timings: 3 Hours
Scheduled Lab per Week: 3 Hours Max. Marks: 100(IA: 60, ETE: 40)
P.67 Write a program to write sentence in a file.
P.68 Write a program to read name and marks ofnnumber of students from user and store them in a file.
P.69 Write a program to read name and marks of n number of students from user and store them in a file , if the file previously
exits then add the information ofn students.
P.70 Write a program to copy contents from one file to another file.
P.71 Write a program to find the total number of lines, words and character in a file.
×)