This repository contains all the C programs done during lab classes.
- Write a C program to sort n alphabets (both upper and lower) in an array in ascending order
- Given a square matrix of size N*N, print the sum of upper and lower triangular elements.
-
Write a C program to find all patterns of 0(2+)0 in given string containing 0's and 2's. Find total number of patterns
Hint: Input: 02202222020
Output: 3
(Since patterns are 0220, 022220, 020) - Given a 2D matrix M of dimensions RxC. Find the maximum sum subarray in it.
- Write a C program to find the maximum sum of continuous subsequence in an array.
- Write a C program to sort the given array in ascending order using pointers only Given array: a[] = A,c,2,&,%,@,t U,0,B
- Write a C program to replace multiples of 5 by a character ‘*’ and multiples of 2 by a character ‘&’ in a 2-D array
- Write a C program to find the occurrence of the sub-string and its starting position in a given string
- Write a C program to find the maximum and minimum of a sub-array of size m in a given array of size n, where n > m using pointers only
-
Write a C program to merge two 2-D arrays satisfying the given conditions
* Find the sum of element in their respective position of two matrix.
* If the sum is even, replace the element with the reminder 0, otherwise with 1. Accordingly, build the resultant merge matrix with the element value as 1 or 0 - Write a C program to find the reverse of the digits of a given number using pointers only
- Write a C program to find and count occurance of a word in an array of strings
- Write a C program to check whether two strings are anagram of each other
- Write a C program to insert a substring anywhere in between the given string except in the first and last position of the string. Finally display the resultant string after inserting the sub-string
- Write a program to find the number of times a given word appears in the given string
- WAP to remove all characters from the given string except the alphabet character and display the final string. (Hint> input: C-*O123D^&E@#S, output: CODES)
- WAP to remove all characters from the given string except the alphabet character and display the final string (without using a second string)
- Write a C program to split the given sentence into words and display the words one after the other.