Вы находитесь на странице: 1из 3

VIT

UNIVERSITY
(Estd. u/s 3 of UGC Act 1956)
Vellore - 632 014, Tamil Nadu, India
School of Information Technology and Engineering

ITE101 – Problem Solving Using C Lab 2023

Lab Exercises

CYCLE SHEET - II

Programme: MS(Software Engineering), B.Tech(IT,Mech,Civil)

Semester : First

ARRAYS
1) Read values into an one dimensional array and compute the sum of
their squares.
2) Enter elements into an array and reverse the order of the elements
in the array.
3) Read elements into an array. Write a Program to find duplicate
elements in the array and display the resultant array by removing
the duplicates.
4) Read n elements into an array. Compute the following searching
methods:
a. Linear Search
b. Binary Search
5) Read n elements into an array and perform the following Sorting
methods:
a. Bubble Sort
b. Insertion Sort
c. Selection Sort
6) Read a line of text into a character array and perform the following
operation:
a. Count the number of Upper case , Lower case, digits and
special characters.
b. Convert Upper case to Lower case and vice versa without
using string library functions.
c. Count the number of words, lines and characters in a given
text.
7) Write a program to copy m consecutive characters from String S1
beginning at position n into another string S2.

8) Read Two Matrix A and B. Compute the Matrix Addition and display
the resultant matrix.
9) Read Two Matrix A and B. Compute the Matrix Multiplication and
display the resultant matrix.
10) Read a Matrix A of size m * n and compute its transpose and
display the result.
11) Write a program to read in an array of names and sort them
in alphabetical order and display the result.
12) The Examination results of n students are tabulated as
follows:

-------------------------------------------------------------------------------
Register No | Subject1 | Subject2 | Subject3
-------------------------------------------------------------------------------
. | | |
. | | |
. | | |
-------------------------------------------------------------------------------

Write a program to read the data and determine the following:


a) Total Marks obtained by each student.
b) Highest Marks in each Subject.
c) Register No of Students who secured highest in each subject.
d) Student who obtained the highest total marks.

Functions

13) Write a function by name print() that prints “Welcome to C


Functions.” Use it in main() function to print “Welcome to C
functions.” five times on separate lines.

14) Code and test a function by name reversedigit() with


appropriate arguments for computing reversing the digits of a
number and returning the result to the calling function.

15) Code a program to accept an integer value. Pass this value to


two functions - one to compute square value, and the other to
compute cube value. Print the results from the functions.

16) Use recursive function to perform the following:

a. Sum of the digits of a number


b. GCD of two numbers

Structures

17) Code a program to do the following with a structure:


a. Declare the structure with the following members:
Name char 20
Age int
Gender char 1
Marks float
b. Initialize the members with your values.
c. Print the memory space occupied by the structure object.
d. Print the formatted structure data.
18) Code to accept 10 telephone customers’ data into a structure
object.
The fields are:
Customer name
Telephone number
Units to be billed

Calculate Bill Amount, which is Rent of Rs. 250 plus Re 0.80 for each
unit. Prepare the Bill and print it.
19) Design a structure student_record to contain name, date of
birth and total marks obtained.
Define a structure data type date containing three integer
members namely day, month and year to represent the date of birth.
Develop a program to read data for 10 students in a class and list
them rank-wise.

File Handling

20) Write a C Program to read data from the keyboard, write it to


a file, again read the same data from the file and display it on the
screen.
21) Write a C Program to copy the content of one file into another
file.
22) Create a file F1 which contains a set of integer numbers. Read
from file F1 and copy the even and odd numbers into two separate
files F2(for storing Even numbers) and F3 (for storing Odd
numbers). Display the content of F2 and F3.

Pointers
23) Write a C Program to perform arithmetic operation and
display the results along with its address.
24) Read two strings and perform string concatenation using
pointers.
25) Perform swapping of two numbers using call by reference
method.

********************

Вам также может понравиться