Varianta C++
----------------------------------
#include <iostream>
using namespace std;
int main()
{ int S=0;
for(int i =1,i<=10;i++)
{ if(i%3==0)
S=S+i;
}
cout<<S;
return 0;
}
--------------------------------
Varianta pseudocod
S<--- 0
i <--- 1
cat timp i<11 executa
{daca i mod 3 = 0 atunci
S <--- S + i
i<--- i +1
}
scrie S