Experiment 1
Experiment 1
Practical File
Experiment – 1
Q2: Write a function, strmdel, that accepts a string and two integers, start and length.
Return a new string that is equivalent to the original string, except that length
characters beginning at start have been removed.
Code:
Output:
Q3: Write a function, strdel, that accepts a string and a character. The function
returns the string with the first occurrence of the character removed.
Code:
Output:
Q4: Write a program (WAP) with a function to swap two numbers using call by
reference.
Code :
Output:
Q5: Write a program (WAP) with a function to swap two integer arrays of the same
size using call by reference.
Code:
Output:
Q6: Write a program (WAP) to reverse an array by swapping (without using
additional memory).
Code :
Output:
Q7: Write a program (WAP) with a function to swap two strings using pointers.
Code:
Output:
Q8: Write a program (WAP) to find the number of non-repeated elements in an array.
Code:
Output:
Q9: Write a program (WAP) to identify the missing numbers in a given array within
the range [1…N].
Code:
Output: