0% found this document useful (0 votes)
134 views6 pages

Lab Manual

This document provides a lab manual for programming principles and algorithms using the C language for the academic year 2019-20 according to the CSJM University Kanpur syllabus. It outlines 10 lab assignments with multiple programming problems and exercises in each assignment covering basic to intermediate concepts of C programming like data types, operators, control structures, functions etc. The objectives of the course are to help students understand problem solving through algorithms and flowcharts, learn C programming methodologies, and design intermediate level problems using C.

Uploaded by

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

Lab Manual

This document provides a lab manual for programming principles and algorithms using the C language for the academic year 2019-20 according to the CSJM University Kanpur syllabus. It outlines 10 lab assignments with multiple programming problems and exercises in each assignment covering basic to intermediate concepts of C programming like data types, operators, control structures, functions etc. The objectives of the course are to help students understand problem solving through algorithms and flowcharts, learn C programming methodologies, and design intermediate level problems using C.

Uploaded by

anshul sachan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

2019

COMPUTER
LABORATORY OF
PROGRAMMING Lab Manual for
the Academic

PRINCIPLE & Year 2019-20


(In accordance
with CSJM
ALGORITHM University
Kanpur syllabus)

(BCA – S102TP)

Page 1
Department of Computer Application (BCA)
PSIT CHE Kanpur Session 2019-2020
Computer Laboratory of Programming Principle & Algorithm (BCA – S102TP)

L T P C
0 0 3 2
AIM:

To enable students in developing programming skills using C language. To improve their


logical ability and to apply these skills for solving problems in scientific, mathematical and
business applications.

OBJECTIVES:

The objectives of the course are:

• To get students understand and solve logical and mathematical problems through
algorithms and flowcharts.

• To know programming methodologies using C language.

• To design and develop solutions to intermediate level problems using the C


language.

• Further develop their skills in software development using a procedural language


(the C language).

LAB CODE:

1. Equipment in the lab for the use of student community. Students need to
maintain a proper decorum in the computer lab. Students must use the
equipment with care. Any damage caused is punishable.
2. Students are required to carry their observation / programs book with completed
exercises while entering the lab.
3. Students are supposed to occupy the machines allotted to them and are not
supposed to talk or make noise in the lab. The allocation is put up on the lab
notice board.
4. Lab can be used in free time / lunch hours by the students who need to use the
systems should take prior permission from the lab in-charge.
5. Lab records need to be submitted on or before date of submission.
6. Students are not supposed to use floppy disks, pen drives and CDs.
7. All the students must wear ID cards, leave their foot wear outside the lab and
must come with a formal dress code.
8. Doesn’t bring bags inside the lab.
Page 2
Department of Computer Application (BCA)
PSIT CHE Kanpur Session 2019-2020
Computer Laboratory of Programming Principle & Algorithm (BCA – S102TP)

List of Experiments
Lab Assignment 1
1 Write a C program to display "Hello Computer" on the screen.
2 Write a C program to display Your Name, Address and City in different lines.
3 Write a program to perform addition, subtraction, integer division, multiplication and modulo
division of two integer numbers
4 Write a C program to find the area of a circle using the formula: Area = PI * r 2
5 Write a C program to find the area and volume of sphere.
Formulas are: Area = 4*PI*R*R, Volume = 4/3*PI*R*R*R.

Lab Assignment 2
6 Write a C program to print the multiply value of two accepted numbers
7 Write a C program to convert centigrade into Fahrenheit. Formula: C= (F-32)/1.8.
8 Write a program to read a character in upper case and then print it in lowercase.
9 Write a program to print the ASCII value of a character.
10 Write a C program to find out whether the character presses through the keyboard is a digit or
not (using conditional operator).

Lab Assignment 3
11 Write a program to find area and circumference of circle with radius r taken from a keyboard.
12 WAP to convert velocity from Km/Hr to m/s.
13 WAP to calculate simple interest and take amount, time and rate of interest from keyboard.
14 WAP to calculate compound interest and take amount, time and rate of interest from keyboard.
15 WAP to determine the equation of straight line passing the points (x1, y1) and (x2,y2).
m= (y2-y1)/ (x2-x1) y1=mx1+c y2=mx2+c

Lab Assignment 4
16 WAP to find the final velocity by using the equation v=u + at.
17 WAP to interchange three values in following way:- put value of y to x, of z to y and x to z.
18 WAP to find the gross salary of a person whose D.A. is 20% of basic salary.
19 WAP to find torque, here the values of m1, m2 should be taken by user at runtime.
Torque= 2m1m2g/(m1+m2)
20 WAP to calculate the energy by equation Energy = [acceleration x height + velocity2/2]

Page 3
Department of Computer Application (BCA)
PSIT CHE Kanpur Session 2019-2020
Computer Laboratory of Programming Principle & Algorithm (BCA – S102TP)

Lab Assignment 5
21 Write a C program to swap variable values of i and j using temporary variable.
22 Write a C program to swap variable values of i and j without using temporary variable
23 Write a C program to find the maximum from given three nos.
24 Write a C program to display the size of every data type.
25 Write a C program to find that the accepted no is Negative, Positive or Zero.
26 Write a C program to convert an integer to corresponding float number and a float number in to
integer number.

Lab Assignment 6
27 Write a program which reads two integer values. If the first is lesser print the message up. If the
second is lesser, print the message down if they are equal, print the message equal if there is an
error reading the data, print a message containing the word Error.
28 Write a C program to enter a character and then determine whether it is vowel or not
29 Write a C program to find given year is a leap year or not
30 Write a C program that prints the given three integers in ascending order using if – else.
31 Write a C program for calculator designing using switch /case loop?
32 Write a C program to find largest in three input integers using nested if---else statement
33 Write a C program to find largest in three input integers using && operator

Lab Assignment 7
34 Write a C program to find the sum of first 100 natural nos.
Produce a multiplication table. Top left hand corner will show 1x1 and bottom right shows 12x12,
as below.
1 2 3 4 5 6 7 8 9 10 11 12
2 4 6 8 10 12 14 16 18 20 22 24
3 6 9 12 15 18 21 24 27 30 33 36
4 8 12 16 20 24 28 32 36 40 44 48
5 10 15 20 25 30 35 40 45 50 55 60
6 12 18 24 30 36 42 48 54 60 66 72
7 14 21 28 35 42 49 56 63 70 77 84
8 16 24 32 40 48 56 64 72 80 88 96
9 18 27 36 45 54 63 72 81 90 99 108
10 20 30 40 50 60 70 80 90 100 110 120
11 22 33 44 55 66 77 88 99 110 121 132
12 24 36 48 60 72 84 96 108 120 132 144
35 Write a C program to find the sum of first 100 odd nos. and even nos.
36 Write a C program to display first 25 Fibonacci nos.
37 Write a C program to display first 100 prime nos.
38 Write a C program to convert decimal to binary.

Page 4
Department of Computer Application (BCA)
PSIT CHE Kanpur Session 2019-2020
Computer Laboratory of Programming Principle & Algorithm (BCA – S102TP)

Lab Assignment 8
39 Write a C program to print the accepted no and its reverse no.
40 Write a C program to convert decimal to octal.
41 Write a C program to convert decimal to hexadecimal.
42 Write a C program to find factorial of accepted nos.
43 Write a C program to find the sum of digits of accepted no.
44 Write a program in C that will scan a number N and then output the sum of the powers from 1 to
N.
Thus, if the input is 4, the output should be 288. 1+4+27+256=288 [1,2,3,4]

Lab Assignment 9
45 Write a C program to calculate the roots of a quadratic equation as real, equal or imaginary
46 Write a C program to print all the Factors of accepted no.
47 Write a C program to find HCF or GCD of two given numbers.
48 Write a C program to find LCM of two given numbers.
49 Write a C program to find all the prime number between two given numbers.
50 The National Earthquake Information Center has the following criteria to determine the
earthquake damages.
Here is the given Richter scale serve as an input data and the characterization as output
information.
RICHTER NUMBER (N)..........CHARACTERIZATION
N<5.0------------little or no damage
5.0<=N<5.5-----some damage
5.5<=N<6.5.----serious damage
6.5<=N<7.5-----Disaster Higher.---------Catastrophe

Lab Assignment 10
51 Write C programs to print the terms of each of the following series:
i. Sin(x) ii. Cos(x) iii. Log (1+x) iv. log(1-x) v. ex vi. e-x
52 Display the following output on screen (assuming the value for input parameter n=5) :
52 53 54
* 1 A
** 12 AB
*** 123 ABC
**** 1234 ABCD
***** 12345 ABCDE
55 56
***** ABCDE
**** ABCD
*** ABC

Page 5
Department of Computer Application (BCA)
PSIT CHE Kanpur Session 2019-2020
Computer Laboratory of Programming Principle & Algorithm (BCA – S102TP)

** AB
* A

Lab Assignment 11
57 57 58 59
- * ABCDE 1
61 ** ABCD 12
*** ABC 123
**** AB 1234
***** A 12345
60 61
1 1
01 22
101 333
0101 4444
10101 55555
62 Write a C Function for the following task
a) Calculating Factorial
b) Find value of a given Fibonacci term
c) Swapping the values of two variable
d) Minimum/maximum value from the given input

Lab Assignment 12
63 Input today’s date and Print yesterday’s date. You can use the ANSI standard functions 'time' and
'ctime'.
An example of the O/P from my program is Fri Mar 17 18:46:47 1995
64 Write a C program to find minimum, maximum, sum and average of the given set of numbers.
65 Write the following recursive C Function
a) Factorial of a given number
b) b. Nth Fibonacci number
66 Write the following recursive C Function
i. Reverse of a given String
ii. Reverse of a give Number

Page 6
Department of Computer Application (BCA)
PSIT CHE Kanpur Session 2019-2020

You might also like