Swift Number Output

🔢 Swift Number Output
1. Printing Integer Numbers
2. Printing Decimal Numbers
Swift supports Double and Float.
Output
3. Printing Multiple Numbers Together
Output
4. Number Output with Text (String Interpolation)
👉 Most important & recommended way
Output
5. Arithmetic Result Output
You can directly print calculations.
Output
6. Integer vs Decimal Division
⚠️ Very important concept
Output
7. Formatting Number Output (Decimals)
Limit decimal places using String(format:).
Output
8. Printing Optional Numbers
9. Using debugPrint() for Numbers
Used mainly for debugging (same output for simple numbers).
❌ Common Mistakes
Wrong ❌
Correct ✅
🧠 Summary
| Task | Method |
|---|---|
| Print integer | print(num) |
| Print decimal | print(Double) |
| Text + number | String interpolation |
| Arithmetic output | Direct print |
| Decimal control | String(format:) |
