Beruflich Dokumente
Kultur Dokumente
BASIC CONCEPTS
1. Develop a program for the following formulae --
Area of a Circle pi * r * r
Area of a Cylinder l*b*h
Area of a Triangle ½*b*h
Area of a Triangle (given Sides) sqrt (s * (s-a) * (s-b) * (s-c))
Simple Interest p * t * r / 100
Quadratic Roots ax2 + bx + c = 0
Sum to n terms n * (n+1) /2
2. Develop a program to Swap two Numbers.
3. Develop a program for calculating the Total Expenses of an Employee.
(Assume the following data: Rent=3000/Electricity Bill=500/Water Bill=300/
Phone Bill=900/Food=1500/Others=3000)
4. Develop a program for calculating the Net Salary of an Employee.
Net Salary = (Basic + DA + HRA + CCA) – IT – PF – Transport
(Assume the following data: DA=30% of BASIC, HRA=15% of BASIC, CCA=500, IT = 20%
of BASIC, PF = 5% of BASIC, Transport = 300).
5. Develop a program to convert Fahrenheit Temperature to Celsius.
13. Develop a program to find whether a triangle is equilateral, isosceles, right angled, etc
given the sides a, b, c.
14. Develop a program to find the different types of roots (real, equal, complex etc) based on
the discriminant of ax2 + bx + c.
15. Develop a program that will read the value of x and evaluate the following function using
if, if else & conditional operators.
Y = 1 for x > 0
Y = 0 for x = 0
Y = -1 for x < 0
16. A cloth show room has announced the following seasonal discounts on the purchase of
items.
Develop a program using switch & if constructs to compute the net amount to be paid by
the customers. The table below shows the Discount in percentages:-
Purchase Amount Mill cloth Hand loom Items
1-100 --- 5.0
101-200 5.0 7.5
201-300 7.5 10.0
Above 300 10.0 15.0
17. Develop a program to calculate the salary of an employee –
Generate net salary based on the tax rates & terms
< 22000 Nil
22001 - 30000 20% of income >20000
30001 - 50000 1600 + 25 % of income >30000
50001 - 75000 6600 + 40 % of income >50000
> 75000 16600 + 50 % of income>75000
2
40. Develop a program to evaluate Sin (x) using the series.
Sin(x) = x–x3 + x5 – …….up to 7 digits accuracy.
--- ---
3! 5!
41. Develop a program to determine and print the sum of the following harmonic series for a
given value of n: 1 + ½ + 1/3 + .... + 1 / n.
42. Develop a program to evaluate the following power series using if-else statement.
E^x = 1 + x + x*x / 2! + x*x*x / 3! + ..... + x^n /n! , 0 < x < 1.
43. Develop a program to evaluate the following power series using if-else statement.
e^x = 1 + x + x*x / 2! + x*x*x / 3! + ..... + x^n /n! , 0 < x < 1.
44. Develop programs for the following Output –
1 1 1
01 22 12
101 333 123
0101 4444 1234
******
1 *
******
232 **
******
34543 ***
******
4567654 ****
******
ARRAYS
47. Develop a program to find sum and average of given N elements in an array.
48. Develop a program to find biggest element in an array of N elements.
49. Develop a program to find least element in an array of N elements.
50. Develop a program to find to add first and last element from a given array.
51. Develop a program to print the given array in reverse order..
52. Develop a program to count number of even and odd number’s in a given array.
53. Develop a program to print numbers in even and odd places of a given array.
54. Develop a program to print second half of the given array.
55. Develop a program to insert an element into a list of elements in the Array.
56. Develop a program to delete an element from a list of elements in the Array.
57. Develop a program to print the elements of array by eliminating the duplicate numbers.
58. Develop a program to count number’s greater than, less than or equal to a number ‘k’ in a
array of N elements.
59. Develop a program to print the following output using a single dimensional array
1 2 3
4 5 6
7 8 9
3
DOUBLE DIMENSION ARRAYS
60. Develop a program to find sum of two matrices.
61. Develop a program to find difference in two matrices.
62. Develop a program to find product of two matrices.
63. Develop a program to print transpose of a given matrix.
64. Develop a program to test whether a given matrix is symmetric or not.
65. Develop a program to print the following diagonal matrix.
1 0 0
0 5 0
0 0 9
66. Develop a program to find the sum of diagonal elements of a given matrix.
67. Develop a program to find the greatest element in a given matrix.
68. Develop a program to find the smallest element if a given matrix.
69. Develop a program to sort all elements in a given matrix.
Eg. input 4 2 7 output 1 2 3
1 9 3 4 5 6
5 6 8 7 8 9
70. Develop a program that performs row wise sorting.
71. Develop a program test whether a given matrix is a lower triangular matrix or not. A
lower triangular Matrix is one in which all the elements above its principal diagonal are 0.
72. Develop a program test whether a given matrix is an upper - triangular matrix or not. An
upper triangular Matrix is one in which all the elements below its principal diagonal are 0.
STRINGS
73. Develop a program to count the number of characters in a string (String length).
74. Develop a program to copy a string to another without using strcpy function.
75. Develop a program to Concatenate Two Strings.
76. Develop a program to compare two given strings the function should return 1 if the strings
are equal and 0 otherwise.
77. Develop a program to reverse a given String.
78. Develop a program to check whether given string is palindrome or not.
79. Develop a program to count the number of words in a string.
80. Develop a program to convert uppercase letters in the string to lowercase & Vice versa.
81. Develop a program to count the number of vowels special characters, consonants in a
given string.
82. Develop a program to find the number of occurrences of each alphabet in a given string.
Assume that the string contain only alphabets.
83. Develop a program to would print the alphabet set a to z and A to Z in ASCII Code.
84. Develop a program to insert a sub string into a String from a particular position onwards.
85. Develop a program to delete n characters in the string from a particular position.
86. Develop a program to extract a portion of a character string and print the extracted string.
Assume that m characters are extracted, starting with the nth character.
87. Develop a program to read a string and rewrite it in the alphabetical order of the string by
ASCII values. For example the word STRING should be written as GINRST.
4
FUNCTIONS
88. Develop a program with functions –
1. Without Arguments & without Return Value
2. With Arguments & without Return Value
3. With Arguments & with Return Value
STRUCTURES
93. Develop a program to assign some values to the members a structure and to display the
same on the screen.
(Members of a structure include the student name, roll number and marks)
94. Develop a program to Define, Assign, Read and Display
a) Book details
b) Student information
c) Employee information
d) Bank A/C information
5
POINTERS
101. Develop a program to access variables through pointers.
102. Develop a program to Student record to find smallest element of an array using pointers.
103. Develop a program to display Student record using Pointers and structures.
104. Develop a program for using call by value and call by reference swap two numbers with
out using temporary variables.
105. Develop a program to allocate memory dynamically using MALLOC function.
106. Develop a program to reverse a string using pointers.
107. Develop a program to using pointers to read an array of integers and prints its elements in
the reverse order.
108. Develop a program to display the content of a 2D array using pointers.
109. Develop a program to find the length of strings using pointers.
FILES
110. Develop a program to read data from the keyboard, write it to a file called VPS and print
the contents of VPS file on the screen.
111. Develop a program to copy the contents of one file to another file.
112. Develop a program to merge two files.
113. Develop a program to count number of tabs, number of lines, characters and blank spaces
in a file.
114. Develop a program to append the contents to a file.
115. Develop a program to convert the lowercase characters of one file to uppercase characters.
116. Develop a program to store student record data in a file.
117. Develop a program to read and print employee details.
(Employee ID, Name, Designation, Salary) using fscanf and fprintf.
6
7