Docsity

C Programming Lab Exercises: Reversing and Comparing Strings, Assignments of Programming Languages

Toggle sidebar
bg1
Lab #14
Page. 1
Lab task 14.1 Write a function Reverse () that reverse a C-string (an array of char). Use a for
loop that swap the first and last character , then the second and next to the last character and so
on pass a string from main() function to Reverse() function an arguments to reverse it.
______________________________________________________________________________
pf2

Partial preview of the text

Download C Programming Lab Exercises: Reversing and Comparing Strings and more Assignments Programming Languages in PDF only on Docsity!

Lab

Page. 1

Lab task 14.1 Write a function Reverse () that reverse a C-string (an array of char). Use a for loop that swap the first and last character , then the second and next to the last character and so on pass a string from main() function to Reverse() function an arguments to reverse it.

______________________________________________________________________________

Lab

Page. 2

Lab Task 14.2 write a function compare () that will take two string as an arguments from main (). Compare these two string whether they are equal are not.

______________________________________________________________________________