36. A cloth show room has announced the following seasonal discounts on purchase of
items.
PURCHASE Discount (Percentage)
AMOUNT Mill Cloth Handloom Cloth
1-100 __ 5.0
101-200 5.0 7.5
201-300 7.5 10.0
Above 300 10.0 15.0
Write a C program using switch and if statements to complete the net amount to be paid
by a customer.
III. Loops
37. Write a program to read an integer, then add up the values of each of the individual
digits, and print out the sum.
38. Write a program to display all the factors of the given integer.
39. Write a program to check whether the given number has a perfect square or not.
40. Write a program to compute prime numbers between 1 and n using nested for loops.
41. Write a program to find GCD of two given numbers.
42. Write a program for square root of a number without using Built-in functions.
43. The total distance traveled by vehicle in ‘t’ seconds is given by distance = ut+1/2at 2
where ‘u’ and ‘a’ are the initial velocity and acceleration. Write C program to find the
distance traveled at regular intervals of time given the values of ‘u’ and ‘a’. The
program should provide the flexibility to the user to select his own time intervals and
repeat the calculations for different values of ‘u’ and ‘a’.
44. Write a program to determine and print the sum of the following harmonic series for a
given value of n:
1 + ½ + 1/3 + …………+1/n
45. Write a C program for the following
a. 1 + x2/2! + x2/4! + ------- upto ten terms
b. x + x3/3! + x5/5! + ------- upto 7th digit accuracy
46. Write a C program for the series of 1/1! + 2/2! + 3/3! + 4/4! ……….
47. Write a C program to read a number and print the number in words
69. Program to display the numbers in the range 1 to 100, which are multiple of 3.
70. Write a program to compute the sum of the series 1/12 – ½2 + 1/32 – ¼2 + …..1/n2
71. Two numbers are entered through the keyboard. Write a program to find the value of
one number raised to the power of another.
72. Write a program to print all Armstrong and strong numbers upto a given range.
73. Find the number of digits in given number.
74. Find the number of odd numbers & even numbers between 0 to given number.
75. To find the given number is unique number or not.
Hint: The reverse of the number * 9 = number
76. Write a program to find the difference between first & last digits of the number.
77. To find the position of the given number.
78. Find the LCM of two numbers.
79. To calculate number of 1’s and 0’s in binary digit number.
IV. Arrays
80. Sum of n numbers in an array.
81. Find the maximum and minimum of n numbers in an array.
82. Prints the array in reverse order.
83. To find the standard deviation.
84. Find the Transpose Matrix.
85. Find out the transpose matrix without using another array.
86. Find the diagonal sum of matrix.
87. Find the sum of two matrixes.
88. Find the second largest and second smallest in an array.
89. Program to insert a string into the main string.
90. Program to delete specified number of characters from the given position in a string.
91. Explain all string handling functions using switch case and loop.
92. Write a C program that outputs the given number at input into words. For example,
for the input 317, the program is to output THREE HUNDRED AND SEVENTEEN.
Assume input value is less than 1000.
93. Write a program to count the number of words, lines and characters in a text.
94. Write a program to count number of characters, no. of words, no. of special characters
in a given string.
95. Write a program to count the number of vowels, special characters and consonants in
a given string.
96. Write a program to sort a list of strings into alphabetical order.
97. Write a program to delete duplicate values in an array.
98. Write a C program to obtain the product of two matrices A of size (3x3) and B of size
(3x2). The resultant matrix C is to be printed out along with A and B. Assume
suitable values for A & B.
99. Write a C 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.
100. Write a program test whether a given line of text is palindrome or not.
101. Write a program to find sum, average and maximum marks of 10 students.
102. To calculate number of even & odd numbers and sum of even and odd numbers in
an array. The array size is 20.
103. Write a program for swapping 2 strings.
104. Write a program to convert Roman numbers into number.
105. Write a program to find the Determinant of a matrix.
106. Write a program to print permutations.
Ex:- i/p:- 345 o/p: 3 4 5 3 5 4 4 3 5 4 5 3 5 3 4 5 4 3
124. Write a program to multiply two numbers without using ‘x’ operator using
functions.
125. Return a maximum number in two integers.
126. Develop all string functions using functions.
127. To calculate sum of n numbers using passing arguments through functions method.
128. To calculate NCR using passing arguments through functions method.
129. Find the sub-string position in main string using functions.
130. Write a program to find the given number is strong number or not using passing
arguments through functions.
131. Write a program to find the given number is Armstrong number or not using
passing arguments through functions.
132. Create a user-defined function for calculating the sum of digits in input number
using recursive method.
133. Write a program to convert decimal numbers to roman equivalent upto 10,000 using
passing arguments through functions method.
134. Write a program to print the number in reverse using recursion method.
135. Write a program to print fibonacci series in recursion method.
136. Write a program for computing area, volume and perimeter of rectangle using
function with looping.
137. Write a Program for Binary, Octal, Hexadecimal Conversions
138. Write a Program to print the ascii values of all characters in the entered string.
139. Write a Program to find & replace any desired character from the input text.
140. To print percentage chart by passing values into functions.
141. Write different functions for swapping for different data types.
142. Write a program add two numbers in recursive method.
143. Write a program to find the gcd of two numbers using the following Euclid’s
recursive algorithm.
gcd(n, m) if n > m
gcd(m, n) m if n = 0
gcd(n, m%n) otherwise
VI. Pointers
144. Write a program to compute the sum of all elements stored in an array using
pointers.
145. Write a C program using pointers to determine the length of a character string.
146. Write a C program develop all string functions using pointers.
147. Write a C program to find out the presence of a sub-string in a given string using
pointers.
148. To find the smallest in an array of ‘n’ elements using pointers.
149. To find the biggest number in two integers using pointers and functions.
VII. Structures and Unions
150. Write an interactive program to process complex numbers. It has to perform
addition, subtraction, multiplication, and division of complex numbers.
151. Write an interactive program, which processes date of birth using structures.
Enhance the same supporting processing of multiple students date of birth.
152. To develop a structure contains Roll number, name, marks [3], total, and average of
a student structure for multiple students and display result of each student.
153. Develop a structure of employee contains name, department and basic salary and
calculate da, hra of each employ.
154. To develop a book_bank structure contains title, author, pages, price for different
books.
VIII. Files
155. Appending the data into existing file.
156. Copy the contents in one file to another file.
157. Display a ‘C’ program at run time.
158. To display the number of words, upper letters, lower case letters, spaces and special
symbols in a file.
159. To store the student details in .txt file.
160. To print the details in an ascending order.
161. /* Menu driven program on files
-----------------------------------------------------------
*/
Nested Loops
Write C programs for the following formats
162. 1 2 3 4 5 163. 12345 164. 1
1234 2345 21
123 345 321
12 45 4321
1 5 54321
171.