0% found this document useful (0 votes)
6 views

Assignment 06

questions of c language

Uploaded by

XG- Räûñãk
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views

Assignment 06

questions of c language

Uploaded by

XG- Räûñãk
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

PDS Lab Section 4

Assignment 06
27th September 2024
Time: 1.5 Hours, Marks: 75

Write a C program that does the following. You cannot include or use string.h. Do
not use Global variables.

a) Read two strings S1 and S2 (of length at most 20 alphanumeric characters)


and print them.
b) Remove all characters that are not lower-case alphabets from both S1 and S2
and push the characters left as needed. Print these modified S1 and S2 again.
Henceforth use these S1 and S2.
c) Find all vowels that are present in both S1 and S2 and print them.
d) Find all consonants that are in S1 but not in S2 and print them.
e) Check whether the string S1 can be formed with the letters of S2 (i) with
repetitions and (ii) without repetitions.
f) Concatenation operator || is defined as all characters of the first string followed
by all characters of the second string. Create and store the concatenations
S1||S2 and S2||S1 as two new strings S3 and S4. Print S3 and S4. Remember
to declare the sizes of S3 and S4 properly as each can be of size 40 characters.
g) Write a separate function removeDuplicates(s) that takes a string s and returns
a new string without the duplicate characters. Call the function from main twice
with S3 and S4 as parameters to get strings S5 and S6. Print S5 and S6.
h) Write another function isEqual(a,b) that takes two strings, a and b, as input and
checks if every character in both strings is the same. The function should return
1 if they are identical and 0 if not. In the main, print an appropriate message
indicating whether the strings are identical or different. Call the isEqual(S5, S6)
function from the main function and print the results.

Write the C Program above. Save the file as A06_<Roll Number>.c (example
A06_24IM10002.c). Build, Run and test it for different test inputs. Then upload the
.c file for the Assignment (Remember to check your C program for readability, add
comments explaining the code).

You might also like