- 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 11 times
Create a class string that reads the string and compute its length. Write a program to overload the operator < and > to
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am
Create a class string that reads the string and compute its length. Write a program to overload the operator < and > to
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