Page 1 of 1

Create a class string that reads the string and compute its length. Write a program to overload the operator < and > to

Posted: Thu Jun 02, 2022 8:24 am
by answerhappygod
Create A Class String That Reads The String And Compute Its Length Write A Program To Overload The Operator And To 1
Create A Class String That Reads The String And Compute Its Length Write A Program To Overload The Operator And To 1 (21.65 KiB) Viewed 13 times
Create a class string that reads the string and compute its length. Write a program to overload the operator < and > to compare two strings. if s1 i< s2 then print "String s1 is smaller than String s2", if s2< s1 then print "String s2 is smaller than String s1" otherwise print "Both the Strings s1 and s2 are Equal". For example: Test Input Result 1 Arun String s1 is smaller than String s2 Bajaj 2 Harshavarthan String s2 is smaller than String s1 Antony James Both the Strings s1 and s2 are Equal James 3