C Programming Laboratory
Sub. Code : 13MCA16 IA Marks : 50
Hrs/Week : 4
Exam Hours : 03
Total Hours : 42 Exam Marks :
100
1. a. Convert degrees into Fahrenheit and vice versa
b. Calculate the salary of an employee given his basic pay,
HRA = 10% of basic pay,
TA=5% of his basic pay and deductions IT = 2.5% of his basic
pay
2. a. Check whether the given number is perfect number
positive divisors, that is, the sum of its positive divisors
excluding the number
itself.
Example - The first perfect number is 6, because 1, 2, and 3
are its proper positive
divisors, and 1 + 2 + 3 = 6.
b. Solve quadratic equations for the given values of a,b,c.
3 a. Generate all
Amstrong numbers upto n.
Defn: An Armstrong number of three digits is an integer such
that the sum of the
cubes of its digits is equal to the number itself.
Example - 371 is an Armstrong number, since 3**3 + 7**3 +
1**3 = 371
b. Convert a decimal number to a hexadecimal number
4. a. Write a menu driven C program to
a. Insert an element into an array
b. Delete an element from the array (first occurrence)
5. a. Write a Menu Driven C Program to
a. Accept a string from the user
b. Encode the string.
c. Decode the string
Apply the following procedure to encode it.
1. Convert each character in a string to its ASCI value.
2. Add an integer value to it and display the encoded string
3. Decode the string using reverse procedure and display.
6. Write a C program to multiply two matrices that satisfy
the constraint of matrix
Multiplication
7. Write a C program to find the saddle point of a matrix.
Defn: Given a RxC Matrix, A, i.e. R rows and C columns we
define a Saddle-Point
as Saddle_Pt (A) for a row I and column j is that A(i,j)
that is the minimum of Row
i and the maximum of Col j.
8. Write a C program to implement a magic square of size n.
Defn: A magic square is an arrangement of numbers (usually
integers) in a square
grid, where the numbers in each row, and in each column, and
the numbers that run
diagonally in both directions, all add up to the same
number.
9. Write a Menu driven C program to
a. Accept two numbers n and m
b. Sum of all integers ranging from n to m
c. Sum of all odd integers ranging from n to m
d. Sum of all even integers ranging from n to m
Display an error message if n > m. Create functions for
each of the options
10. Write a Menu Driven C Program to implement the following
using recursion
a. Factorial of a number
b. Fibonacci series
11. Create a structure Complex Number having real and
imaginary part as properties.
Write functions to add and subtract the two complex numbers.
12. Define a structure called student having the properties
of student_id, student name
and branch of the student
with a sub structure of marks of 3 subjects. Write a
Menu Driven C
Program to
a. Add new student detail
b. Delete a student detail
c. Display all student details
d. Display the average marks scored by the students
13. a. Write a C Program to remove all white spaces and
newline characters from a
file.
b. Find whether a given word exists in the file. If it
exists display the location of the
word
14. Write a C program to copy one file content to another
file without using inbuilt
functions
0 comments:
Post a Comment