C Programming Assignments
C Programming Assignments
INPUT
a=4
b=5
Output
a=5
b=4
8. Any year is input through the keyboard. Write a program to determine whether
the year is a leap year or not.
9. Given three points (x1, y1), (x2, y2) and (x3, y3), write a program to check if all the
three points fall on one straight line.
10. A university has the following rules for a student to qualify for a degree with A
as the main subject and B as the subsidiary subject:
Write a program to receive marks in A and B and Output whether the student
has passed, failed or is allowed to reappear in B.
5000-9999 5%
10000-19999 10%
20000-39999 15%
40000-49999 20%
28. Wap in c that input n numbers in an array and reverse the elements of the array.
Example:
Input : 5 6 9 3 2
Output: 2 3 9 6 5
29. Wap in c that input n numbers in an array find the sum of prime numbers among n
numbers in the given array.
30. Wap in c that input n numbers in an array find the maximum and minimum number
.
31. Wap in c that input n numbers in an array find the 2nd maximum and 2nd
minimum number .
32. Wap in c that input n numbers in an array and a key value which is to be searched
and print the location of the key value using linear search.
33. Wap in c that input n numbers in an array and a key value which is to be searched
and print the location of the key value using binary search.
34. Wap in c that input n numbers in an array and a key value and perform binary
search and linear search using function and switch case.
35. Wap in c that input n numbers in an array and print the array elements in
ascending order and descending order using bubble sort.
36. Wap in c that input n numbers in an array and print the array elements in
ascending order and descending order using selection sort.
37. Wap in c that input n numbers in an array and print the array elements in
ascending order and descending order using insertion sort.
38. Wap in c that input n numbers in an array and remove the duplicate elements
from the array.
Example:
Input:
Array : 3 6 7 8 6 2 3
Output:
36782
39. Wap in c that input n numbers in an array and a value and a position, insert the
the input value in the given position.
Example:
Array : 3 6 7 8 9 2
Value: 4
Position: 3
Outp[ut: 3 6 7 4 8 9 2
40. Wap in c that input n numbers in an array and find the occurrence of each number
in the given array.
Input:
Array : 3 6 7 8 6 2 3 3 2
Output:
3 occur 3 times
6 occur 2 times
7 occur 1 times
8 occur 1 times
2 occur 2 times
41. Wap in c that input n,m numbers in two array say A[ ] ,B[ ] respectively then merge
the elements of two array A[] and B[] one after another( that means all the
elements of the A array then all the elements of the B array) into new array called
C[], and print the new array C[].
42. Wap in c that input n,m numbers in two array say A[ ] ,B[ ] respectively in a sorted
order then merge two sorted array A and B into another sorted array called C[ ],so
that all the elements of the C[ ] array are in a sorted order ,and print the new array
C[].
43. Wap in c that input n numbers in an array then split the elements of the array into
two different arrays EVEN[ ] and ODD[ ] based on even and odd numbers
respectively.
44. Wap in c that input n numbers in an array then split the elements of the array into
two different arrays EVEN[ ] and ODD[ ] based on even and odd position
respectively.
Output :
56. Wap in c the remove the multiple space with a single space in a string.
Example:
Example:
58. Wap in C that adds,subtract,multiply,and divide two complex number stores into
another complex number using switch case.
59. Wap in C that defines a data type student which contains 3 parts
name,roll,marks,enter the record of N students and find the record of the student
who gets maximum and minimum marks.
60. Wap in C that defines a data type student which contains 3 parts
name,roll,marks,enter the record of N students and display the record of the
student in ascending order based on the marks.
61. Wap in C that defines a data type Book which contains 3 parts subject,author
name,price enter the record of N books and find the record of the book which has
maximum and minimum price.
62. Wap in C that defines a data type Book which contains 3 parts subject,author
name,price enter the record of N books and display the record of the book in
ascending order.
63. Wap in c that will read content from a file and write content into a file.
64. Wap in c that will copy the content of one file into another file.
65. Wap in c that reads content from a file which contains multiple word line by line
and find the palindrome word and store it in another file.
66. Wap in c that will perform the encryption on the reading content from a file and
store it another file.
Example:
input.txt
adbfxy
Output.txt
cfdhzy
67. Wap in c that copy the structure content from a file and write it into another file.
68. Wap in c that performs some of the string related programmes mentioned above
using a file that I mentioned in the class.
69. Wap in c that performs command line argument related programmes that I will
mention in the class.
70.
71.
72.