0% found this document useful (0 votes)
379 views4 pages

C Programming Lab Manual for BCA 1st Sem

This document is a lab manual for a C programming lab course at Maharishi University of Information Technology. It contains the name and details of the teaching assistant and professor in charge of the course. It also lists 12 experiments to be performed in the lab related to basic C programming concepts like arithmetic operations, patterns, series, arrays, matrices, functions, pointers, structures, and sorting. It includes spaces to fill in the student's name, roll number, and date and faculty signature after completing each experiment.

Uploaded by

sahil Chaudhary
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
379 views4 pages

C Programming Lab Manual for BCA 1st Sem

This document is a lab manual for a C programming lab course at Maharishi University of Information Technology. It contains the name and details of the teaching assistant and professor in charge of the course. It also lists 12 experiments to be performed in the lab related to basic C programming concepts like arithmetic operations, patterns, series, arrays, matrices, functions, pointers, structures, and sorting. It includes spaces to fill in the student's name, roll number, and date and faculty signature after completing each experiment.

Uploaded by

sahil Chaudhary
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

LAB FILE

For
C PROGRAMMING LAB
(BCA-111)
1st Semester
Bachelor of Computer Application
(SoET)
Session: 2023-24

Miss. Anshuli Dr. Savita

Teaching Assistant Assistant Professor

Department of Computer Application Department of Computer Application


Maharishi University of Information Technology
Noida-201304

BCA-111- Department of Computer Application

LAB MANUAL

NAME :
REGNO :
YEAR / SEM :
DEPT :
Maharishi University of Information Technology,
Noida-201304

C PROGRAMMING LAB (BCA-111)


Session: 2023-24

SUBMITTED BY:
Name: ____________________
Roll No. ___________________

1st SEMESTER: BACHELOR OF COMPUTERAPPLICATION

SUBMITTED TO:
Miss. Anshuli Dr. Savita

Teaching Assistant Assistant Professor

Department of Computer Application Department of Computer Application


INDEX
Sr. Experiment Pg Date Faculty
no No. Sign.
Write a C program to compute addition,
1 subtraction, multiplication, division and
modulus?
Write a c program to print Fibonacci series
2 up to a given number?

Write a C program to check whether the


3 triangle is equilateral, isosceles or scalene
triangle?
Write a C program to print the following
patterns (take number of lines as input
from the user).
4 *
**
***
****
Write a C program to find out the sum of
5 series 1+2+3+……+n?

Write a C program to read N number of


6 values in an array and display them in
reverse order?
Write a C program to find sum and
7 subtraction of two matrices?
Write a C program to swap the value of two
8 variables by call by function?
Write a C program to count the digits of a
9 given number using Recursion?
Write a C program to add 2 numbers using
10 pointers?
Write a C program to store the information
11 of students using structure?
Write a C program to sort an array using
12 Bubble Sort?

Common questions

Powered by AI

The document suggests using a function that swaps the values by using pointers. By passing the addresses of the variables to the function, the actual values in the memory are swapped, not just the local copies of them, allowing for memory manipulation directly.

The program reads the array values into a sequential data structure. It then iterates over the array, swapping elements from the ends towards the center, effectively reversing the entire array. This often involves a temporary storage variable to facilitate the swapping process between endpoints.

The program iterates through two matrices element by element using nested loops. For addition, corresponding elements are summed and the result is stored in a new matrix. For subtraction, elements of the second matrix are subtracted from the first and stored accordingly. This process requires managing indices accurately to correspond each element correctly.

The program uses a loop to calculate and print each Fibonacci number sequentially. It starts with base cases (0 and 1) and then iteratively adds the two previous numbers to generate the next number in the series up to the given limit.

Recursion simplifies the process by breaking down the number into smaller subproblems where each recursive call processes a smaller number. By dividing the number by 10 recursively (base 10 system), the program effectively reduces the problem size until the base case (number with a single digit) is reached. This approach reduces the problem to continually removing and counting the last digit.

The program utilizes a loop to iterate over numbers from 1 to n, accumulating a running total in each iteration step, thereby computing the final sum. Alternatively, it could use the mathematical formula n(n+1)/2 for computational efficiency.

The program considers the lengths of the sides of a triangle. If all three sides are equal, it classifies the triangle as equilateral. If two sides are equal, the program identifies it as an isosceles triangle. Otherwise, if all sides are different, it is classified as scalene. These checks typically involve conditional statements (if-else)

Bubble sort repeatedly steps through the list to be sorted, compares adjacent elements, and swaps them if they are in the wrong order. This process repeats until the list is sorted, ensuring larger elements 'bubble up' to their correct position at the end with each pass through the array.

Structures in C are effective because they allow the grouping of different types of data as a single entity. For student information, a structure can easily contain various data fields like name, roll number, marks, which may be of different data types, enabling efficient handling and manipulation of related data collectively.

Using pointers for addition allows direct manipulation of memory addresses rather than copying variable values. This can lead to efficiency improvements, especially in functions, by modifying values directly in their memory location. It also demonstrates a deeper understanding of memory management in C.

You might also like