Sie sind auf Seite 1von 7

C Program List

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.

IF … ELSE / SWITCH … CASE CONSTRUCT


6. Develop a program to check whether a number entered is even or odd.
7. Develop a program to check whether a number entered is positive or negative.
8. Develop a program to check which of the 3 numbers entered is the highest.
9. Develop a program to accept a number and display the same in Words.
(ex: 123 – One Two Three)
10. Develop a program to print 3 numbers entered in the ascending order.
11. Develop a program to accept a number and display the sum of its digits.
12. Develop a program to generate a Electricity Bill for the following rules –
Domestic < 100 units Rs 1.50
100 - 300 units Rs 2.00
301 - 500 units Rs 2.50
L.T.Consumer 501 - 1000 units Rs 4.00
H.T.Consumer > 1000units Rs 5.00

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

DO … WHILE / WHILE … DO / FOR LOOPS


18. Develop a program to display first N natural numbers.
19. Develop a program to display the sum of N natural numbers.
20. Develop a program to find the Factorial of a given number.
21. Develop a program to accept 10 numbers – check whether the number is divisible by 10 –
count for the numbers that are divisible and not divisible – display the count at the end.
22. Develop a program to print the Fibonacci Series.
23. Develop a program for printing the multiplication table.
5*1=5
5 * 2 = 10


5 * 10 = 50
24. Develop a program to reverse a number accepted as an input.
25. Develop a program to find the sum of digits in a number.
26. Develop a program to check whether the number entered is a Palindrome.
27. Develop a program to convert a number accepted in Decimal form to Binary.
28. Develop a program to check whether the number entered is a Prime Number.
29. Develop a program to check whether the number entered is a Perfect Number.
30. Develop a program to check whether the number entered is a Fibonacci Number.
31. Develop a program to check whether the number entered is an Armstrong Number.
32. Develop a program to find Prime Numbers between 1 & 100.
33. Develop a program to find Perfect Numbers between 1 & 500.
34. Develop a program to find Armstrong Numbers between 1 & 1000.
35. Develop a program to find Twin Prime Numbers between 1 & 100.
36. Develop a program to find Pythagoras numbers between 1 & 100.
37. Develop a program to find the Sum upto 25 terms –
1 + ¼ + 1/9 + 1/16……..
38. Develop a program to determine and print the sum of the following harmonic series for a
given value of n -
HM = 1 + ½ + 1/3 + .... + 1 / n.
39. Develop a program to evaluate following series assume suitable value for x.
Y=1 + x2 + x4 + x6 + … … … up to 10 terms.
---- ---- ----
2! 4! 6!

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 ****
******

45. Develop a program to print Pascal’s triangle


1
1 1
1 2 1
1 3 3 1
1 4 6 4 1
1 5 10 10 5 1
………………..
46. Develop a program to print the Floyd's triangle.
1
2 3
4 5 6
7 8 9 10
11..12 13 14 15

79 … … … … … … 91

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

for the following –


a) Sum of digits of in given number.
b) Factorial of a given number.
c) G.C.D. of two given numbers.
d) Check whether the given number is prime or not
e) Check whether the given number is strong or not
89. Develop programs for calculating the following --
a) n
cr
b) n
pr
90. Develop a program with functions using Arrays –
a) Largest of N numbers.
b) Sum and average of N numbers.
c) Sorting of N numbers.
91. Develop a program with Recursive Function for --
Factorial of a given number.
a) Generation of Fibonacci series.
b) G.C.D of a given two numbers. (Greatest Common Divisor)
92. Differentiate between call by value and call by reference using a Develop a program to
swap two numbers.

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

95. Develop a program to compare two structure variables.


96. Develop a program to find total and average of sales of all employees using array of
structure.
97. Develop a program to read a set of Name, Roll Number, Date of Birth and Date of
Admission of the students in the college from the keyboard where the date of birth and
date of admission consists of three members such as day month and year as a separate
structure.
98. Develop a program to illustrate the method of sending and one entry of the structure as a
parameter to a function.
99. Define a union called cricket that will describes the following information.
a) Player name
b) Team name
c) Batting average
100. Develop a program to send the entire data of a structure to a function.

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

Das könnte Ihnen auch gefallen