Commit e1f7262
committed
feat: Categorize website type based on domain extension using switch-case
🧠 Logic:
- Accepts a website URL as user input and extracts the domain extension using `substring` after the last dot.
- Uses a `switch-case` structure to identify and print the website type:
- `.com` → Commercial Website
- `.org` → Organization
- `.gov` → Government
- `.net` → Network
- Converts extension to lowercase for case-insensitive matching.
- Demonstrates practical string handling and conditional branching based on web domain classification.
Signed-off-by: Somesh diwan <[email protected]>1 parent e214f4f commit e1f7262
1 file changed
+2
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| 29 | + | |
| 30 | + | |
29 | 31 | | |
30 | 32 | | |
31 | 33 | | |
0 commit comments