Beruflich Dokumente
Kultur Dokumente
Total: 12 Weeks
Note: Each lab contains total 8 programs.5 for lab Exercise and 3 for assignment.
3. Write a program to find the distance travelled by an object (i.e s=ut+ (1/2)at2)
Assignment:
*1. Write a program to swap two values without using temporary variable.
2. Write a program to convert Fahrenheit to Celsius using the formula: C = (F−32)/1.8
3. Write a program to read the values of x, y and z and print the results of the following
expressions in one line.
a = (x+y+z)/(x−y−z), b = (x+y+z)/3 , c = (x+y)*(x-y)*(y-z)
*2. Write a program to which reads 3 student marks and find the average marks of the passed
students only
*3. Write a program to find the maximum between three integers using conditional operator.
4. Write a program to check the given character is lowercase, uppercase, digits or others.
Assignment:
1. Write a program to print the grade of the student as follows (use relational operators only)
2. W a p which reads three integers and check whether last 2 values are factors to the first value
or not
3. Write a Program to convert no. of days into no. Of years, no.of months and no. Of days
*2. An electric power distribution company charges its domestic consumers as follows:
Write a C program that reads the customer number and power consumed and prints the amount
to be paid by the customer.
Given the marks in three subjects, write a C program to process the application to find whether
eligible or not.
If m>=60 print grade as FIRST If m>=50 and m<60 print grade as SECOND
If m>=40 and m<50 print grade as THIRD If m<40 print grade as FAILED
*5. Wap to perform arithmetic operations using switch statement.
Assignment:
*1. Wap to find the roots of a Quadratic equation by checking necessary conditions.
Write a C program to read purchase extent and calculate discount. Also print the purchase
amount and discount.
3. Candidates have to score 90 or above in the IQ test to be considered eligible for taking further
tests. All candidates who do not clear the IQ test are sent reject letters and others are sent call
letters for further tests. Write a program to Represent the logic for automating this task.
*2. Write a program to find the sum of individual digits of a given number.
3. Write a program which reads n student marks and finds the maximum1 and maximum2
marks.
*4. A Fibonacci sequence is defined as follows: the first and second terms in the sequence are 0
and 1. Subsequent terms are found by adding the preceding two terms in the sequence. Write a C
program to generate the first n terms of the sequence.
Assignment:
*1. Write a C program to generate all the prime numbers between 1 and n, where n is a value
supplied by the user
Sum=1-x2/2! +x4/4!-x6/6!+x8/8!-x10/10!
2.2’s complement of a number is obtained by scanning it from right to left and complementing
all the bits after the first appearance of a 1. Thus 2’s complement of 11100 is 00100. Write a C
program to find the 2’s complement of a binary number.
3. Write a program which reads n student ids and marks and print the id of the student who got
max marks.
*4. Write a program to find both the largest and smallest number of an array of integers.
Assignment:
1. Write a C program that uses functions to perform the following operations:
*2. Write a program to count the lines, words and characters in a given text.
*3. Wrte a function which takes the sides of the triangle(a,b,c) as arguments and return the Area
of triangle(Area=sqrt(s*(s-a)*(s-b)*(s-c))
4. Write a program to find the power (a, b) using recursion.
*5. Write a program to find the factorial of a given number using recursion
Assignment:
1. Write a function to return the value of the following function. Square(m( )+n( ) )
*3. Write a program find the GCD (greatest common divisor) of two given integers using
recursion.
*2. Write a function which takes 1d integer array as an argument and return the sorted array.
5.Write a function which takes an odd square matrix as an input and return the sums of
individual blocks as follows:
* * * *
* * * *
* * * *
* * * *
Assignment :
1. Write a function which takes 1d integer array as an argument and return the maximum value
2. Write a function which takes a matrix as an argument and return its transpose
2. Write a function which takes a string as an argument and return the no. of lower cases, no.of
upper cases, no.of digits and others.
*3. Write a program for Pointer based function to exchange value of two integers using passing
by address
4. Write a function which takes a string as an argument and return its length.
*5. Waf which takes a 2 matrices as an arguments and return its addition
Assignment:
1. Wap to check the given string is palindrome or not.
2. Write a function to check the given matrix is symmetric matrix or not using pointers
3. Write a function which takes a matrix as an argument and return the sum of elements of
middle row ,and sum of elements of middle coloumn.
4. Write a program to find the sum of elements of lower triangular matrix(using array of pointers
technique).
*5. Write a program to find the sum of elements of principal diagonal and other diagonal
elements(using pointer to pointer technique).
Assignment:
*1. Write a program to print the elements in reverse order stored in 1d array.(using malloc( ))
2. Write a program to find the sum of elements of upper triangular matrix(.using array of pointers
technique)
3. Write a program to find the sum of elements of middle row and middle column of of the odd
square matrix.(pointer to pointer technique)
*2.Define a structure with the name student which contains sno,sname,marks.wap to read and n
students information and print the details of the students whose marks greater than or equal to
average marks of the students.
3.Define a structure with the name student which contains sno,sname,marks.wap to read n
students information and print the details of the students in asenending order.
4.Define a structure with the name complex which contains rael part and imaginary part.write the
functions to add, subtract and multiply two complex numbers using returning as an complex
number.
5.. Define a structure with the name Date which contains day,month,year. Write a function which
takes two dates as an arguments print the largest date.
Assignment:
1. Write a C program which generates array of structures, each structure represents an “item”
which contains item code, item name, stock in hand, unit price. Read n items information from
the keyboard. Given item code and quantity to be purchased. Calculate and point total price
along with other details.
* 2.Write a C program to compute the monthly pay of 100 employees using each employee’s
name, basic-pay. The DA is computed as 52% of the basic pay. Gross-salary (Basic-
pay+DA).Print the employees name and gross salary.
3. Write a C program using structure to create a library catalogue with the following fields;
Access number, author’s name. Title of the book, year of publication, publisher’s name, price.
Week11:UNIT-7:STRUCTURES , POINTERS,NESTED STRUCTURES
*1. Write a function to compare two structure variables.
*2. Write a function to copy the contents of one student into another student record Of same
type.
3. Write a function which takes a student structure as an argument and modify the original
student details using pointers.
*4. Write the functions to add, subtract and multiply two complex numbers using pointers.
5. Write a C program to store the information of vehicles. Use bit fields to store
the status information. Assume the vehicle object consists of type, fuel and model
member fields. Assume appropriate number of bits for each field.
Assignment:
1. Write a program to print the details of the student using pointers.
2. Write a program to print college and students information by nesting the students structure in
college structure.
3. Write a program to use structure within union. Display the contents of structure elements
2. Write a program to count the number of words, lines and characters in the given file.
3. Write a program to copy n student records into a file and read all the records from the copied
file and print the records of the students on the monitor hose marks are greater than or equal to
70 by reading the data from the file..
*4.Wap to display the total price of each item by reading the data from a file as follows:
Assignment:
*1 .Write a program to print the data of the file onto the monitor in reverse order.
2. Write a C program to read numbers from a file DATA, contains a series of integer numbers,
and then write all odd numbers to a file to be called ODD and all even numbers to a file to be
called EVEN.
Record programs = 35
Total programs = 96