KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I've a for loop which keeps incrementing an integer value till the loop completes. So if the limit n is a double variable and the incremented variable 'i' is an integer, i gets incremented beyond its limits. double total = 0; double number = hugetValue; for (int i = 1; i <= number; i++) { total = total + i; } return total; What happens to 'i' if it exceeds its capacity? How the value of i changes? Will i get a runtime error?
Tags (comma-separated)
Save Edits
Cancel