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

Two c programming lab tasks. The first task requires writing a reverse() function to reverse a given string using a for loop and character swapping. The second task involves writing a compare() function to determine if two given strings are equal or not. These functions can be passed strings from the main() function for processing.

Typology: Assignments

2019/2020

Uploaded on 12/14/2020

razaroghani
razaroghani 🇵🇰

4.5

(4)

151 documents

1 / 2

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

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.

______________________________________________________________________________