Professional Documents
Culture Documents
13. Write a C program to calculate the angle of a rectangle if two angle are given as input.
(a+b+c=180)
14. Write a C program to read the consumer number and number of units consumed and the
cost per unit and print the amount to be paid.
(Amt=num of units*cost)
15. Write a C program to find addition of two numbers using subtraction operator.
Sum=a-(-b)
16. Write a C program to read a character, and two integer numbers and print the ASCII
value of the given character, find quotient and remainder of two given integer numbers.
17. Write a C Program to calculate area and perimeter of a triangle.
Perimeter=(a+b+c)
s=(a+b+c)/2
Area=sqrt(s*(s-a)(s-b)*(s-c))
18. Write a C program to
19. read five Subject marks and find the average.
20. Write a C Write a program to read the values of x, y and z and print the results of
the following expressions in one line.
1. (x+y+z) / (x-y-z)
2. (x+y+z) / 3
1. Write a C Program to find the Sum of Series sum=1 + 1/2 + 1/3 + 1/4 + … + 1/N.
2. Write a C program to generate the pattern
*
* *
* * *
1
1 2
1 2 3
1 2 3 4
10. Write a C Program to find the Sum of Series sum=1 + 1/2! + 1/3! + 1/4 !+ … + 1/N!.
11. Write a C program to generate pattern.
1
232
34543
4567654
567898765
12. Write a C Program to find the sum of series 1^2 + 2^2 + …. + n^2.
13. Write a C program to generate pattern
*
*A*
*A*A*
*A*A*A*
14. Write a C Program to find the sum of series sum=1^3 + 2^3 + …. + n^3
15. Write a C Program to find the sum of series sum=1/2-3/4+5/6-7/8........up to nth term
WEEK-6
Programs on 1-D Arrays
1. Write a C program to print the repeated elements with frequency count in an
array.
2. Write a C Program to find largest and smallest element in an array.
3. Write a C Program to find the number of non repeated elements in an array.
4. Write a C Program to find 2nd largest and 2nd smallest element in an array.
5. Write a C Program to put odd and even elements of given arrays into two separate
arrays.
6. Write a C Program to find sum and average of all elements in an array.
7. Write a C Program to copy the elements of one array to another array.
8. Write a C Program to merge two arrays into third array
9. Write a C Program to search for an element in the given array.
10. Write a C Program to insert an element in a specified position in the given array.
11. Write a C Program to delete specific element from the given array.
12. Write a C Program to cyclically permute the elements of the array.
13. Write a C Program to sort the elements of the array.
14. Write a C Program to swap every pair of elements in the given array.
15. Write a C program to calculate the fraction of positive numbers, negative numbers
and zeros in the given array.
WEEK-7
Programs on 2-D Arrays
1. Write a C Program to print diagonal elements of given matrix
2. Write a C Program to find transpose of a given matrix.
3. Write a C Program to find whether given matrix is symmetric or not.
4. Write a C Program to calculate the sum of elements of each row in given matrix
using functions.
5. Write a C Program to calculate the sum of elements of each column in given
matrix using functions.
6. Write a C program to find sum of main and opposite diagonal elements of a
matrix using functions.
7. Write a C program to print lower triangular matrix
8. Write a C program to print upper triangular matrix
9. Write a C Program to find multiplication of two matrices.
10. Write a C Program to find addition of two matrices using functions.
11. Write a C Program to find subtraction of two matrices using functions.
12. Write a C Program to check whether two given matrices are equal or not.
13. Write a C Program to check whether given matrix is identity matrix or not.
14. Write a C program to find trace and normal of a given matrix.
15. Write a C program to interchange two diagonals of a given matrix.
WEEK-8
Programs on non recursive functions
1. Write a C Program to insert a sub string into main string at a given position.
2. Write a C Program to delete n characters from given string from the given
position.
3. Write a C Program to check whether given string is palindrome or not.
4. Write a C Program to check the sub string is present in the main string or not. If it
present return the position otherwise return -1 .
5. Write a C program to count number of vowels, consonants, digits and special
characters in a given string.
6. Write a C program to check two strings are equal or not without using strcmp()
function
7. Write a C program to concatenate two strings without using strcat() function.
8. Write a C program to find the length of the given string without using built in
function.
9. Write a C program to replace lowercase characters by uppercase and uppercase
characters by lowercase in the given string.
10. Write a C program to count number of lines, words and characters in the given
text.
11. Write a C Program to remove all Characters in a String except alphabet.
12. Write a C Program for Return maximum occurring character in the input string.
13. Write a C Program for Print reverse of a string using recursion.
14. Write a C Program to reverse words in a given string.
15. Write a C program to copy the content of one string to another without using
strcpy() function.
WEEK-11
Programs on Pointers and Structures
1. Write a C program to read the elements of 1-d array using pointers and print them in
reverse order using pointers.
2. Write a C Program to read two elements dynamically using malloc() function and
interchange the two numbers using call by reference.
3. Write a C Program to read and print the elements of 1-D array using calloc() memory
allocation function and reallocate memory for the array by increasing the size of the
array, read and print the elements of reallocated array.
4. Write a C Program to read and print elements of 1-D array using calloc() memory
allocation function.
5. Write a C Program to print 2-D array using pointers.
6. Write a C program to store name, roll number, year and marks of three subjects of n
students and print the student the name, roll number, average and grade based on average
marks of the student using structures.
7. Write a C Program to read real and imaginary parts of a complex number using structures
and perform the following operations on complex numbers.
Add two complex numbers.
Multiply two complex numbers.
Subtract two complex numbers.
8. Write a C Program to read time in hours, minutes, seconds using structures and perform
the following operations on time.
Addition of two time periods
Subtraction of two time periods
9. Write a C Program to read distance in inches and feet using structures and perform the
following operations
Add two distances
Subtract two distances
10. Write a C program to read employee details employee number, employee name, basic
salary, hra and da of n employees using structures and print employee number, employee
name and gross salary of n employees.
11. Write C program that can be used to read item details used in party and calculate all
expenses, divide expenses in all friends equally using structures.
12. Write a C Program to Create a structure to specify data on students given below: Roll
number, Name, Department, Course, Year of joining
(a) Write a function to print names of all students who joined in a particular year.
(b) Write a function to print the data of a student whose roll number is given.
13. Write a C Program to Create a structure to specify data of customers in a bank. The data to
be stored is: Account number, Name, Balance in account.
(a) Write a function to print the Account number and name of each customer with balance
below Rs. 100.
(b) If a customer request for withdrawal or deposit, it is given in the form: Acct. no, amount,
code (1 for deposit, 0 for withdrawal)
14. There is a structure called employee that holds information like employee code, name, date
of joining. Write a C Program to create an array of the structure and enter some data into it.
Then ask the user to enter current date. Display the names of those employees whose tenure
is 3 or more than 3 years according to the given current date.
15. Write a C Program that compares two given dates. To store date use structure say date that
contains three members namely date, month and year. If the dates are equal then display
message as "Equal" otherwise "Unequal".
WEEK-12
Programs on Files