prasanta sahoo
SOA University
Followers: 0 Following: 0
Statistica
MATLAB Answers
1 Domanda
0 Risposte
RANK
198.980
of 300.369
REPUTAZIONE
0
CONTRIBUTI
1 Domanda
0 Risposte
ACCETTAZIONE DELLE RISPOSTE
100.0%
VOTI RICEVUTI
0
RANK
of 168.436
CONTRIBUTI
0 Problemi
0 Soluzioni
PUNTEGGIO
0
NUMERO DI BADGE
0
CONTRIBUTI
0 Post
CONTRIBUTI
0 Pubblico Canali
VALUTAZIONE MEDIA
CONTRIBUTI
0 Punti principali
NUMERO MEDIO DI LIKE
Feeds
Domanda
Write a function called one_per_n that returns the smallest positive integer n for which the sum 1 + 1/2 + 1/3 + … + 1/n , is greater than or equal to x where x is the input argument. Limit the maximum number n of terms in the sum to 10,000 .
function out=one_per_n(x) if x>10000 out=-1; %fprintf('-1\n'); else total=0; for n=1:x; total=(total+(1/n)); end if...
oltre 10 anni fa | 5 risposte | 0