Advertisement
Adytzu04

l1p1

Feb 18th, 2013
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MatLab 0.35 KB | None | 0 0
  1. %Notam cu Sn suma sirului numerelor naturale mai mici sau egale cu N; Sa se scrie un
  2. %program care va determina cel mai mic numar natural N cu prop Sn>un numar dat(1000).
  3.  
  4.  
  5. clear; %sterge var din memorie
  6. clc; % sterge fereastra unde sunt afisate
  7.  
  8. help l1p1.m
  9.  
  10. N=1000;
  11. i=1;
  12.  
  13. Sn=0;
  14.    
  15. while (sum(1:i)<N)
  16.    
  17.         i=i+1;
  18. end
  19.    
  20. i
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement