Döngüler
1. For Döngüsü
for (initialization; condition; update) {
// Döngü bloğu
}function sum(uint256 _n) public pure returns (uint256) {
uint256 total = 0;
for (uint256 i = 1; i <= _n; i++) {
total += i;
}
return total;
}2. While Döngüsü
3. Do-While Döngüsü
Örnek Uygulama
Last updated