Create a class string that reads the string and compute its length. Write a program to overload the operator < and > to
-
answerhappygod
- Site Admin
- Posts: 899604
- 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
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!