+ 1

Print number m to n which is divisible by 5

do in for loop

31st Mar 2017, 11:32 AM
suresh krishna
3 Réponses
+ 10
This's the C++ Version int m,n; cin >> m; cin >> n; for(int i = m;i<n;i++){ if(i%5 == 0){'Print '+ i 'is divisible by 5' }; } // Javascript Version var start = prompt('Start Number'); var end = prompt('End Number'); for(i = start; i < end; i++){ document.write(i + 'is divisible by 5') };
31st Mar 2017, 11:44 AM
Chirag Bhansali
Chirag Bhansali - avatar
+ 8
public static void main (int m,int n) {for(int x=m;x<=n;x++) {if (x%5==0) System.out.println(x); } }
31st Mar 2017, 12:06 PM
Saumya
Saumya - avatar
0
input_m input_n for(I=0;I<n;i++) if(i%5==0): print('i')
31st Mar 2017, 12:04 PM
suresh krishna