+ 3

how to write a series of increasing cmmndiff with a cmmndiff 1 upto 7 terms starting from 0.

write an Ap

8th Mar 2017, 12:57 PM
Abdus Samad
Abdus Samad - avatar
8 odpowiedzi
+ 11
did you mean like this? 0 1 2 3 4 5 6 7 ?
14th Mar 2017, 10:16 AM
Art456
Art456 - avatar
+ 11
hmmm. i am sory i don't know
14th Mar 2017, 11:36 AM
Art456
Art456 - avatar
+ 3
According to me it will fulfil your requirements
14th Mar 2017, 11:47 AM
N.Neeharika Reddy
N.Neeharika Reddy - avatar
+ 3
If you want it in java script then it would be somewhat like this <html> <head> </head> <body> <script> var a=0; var res=0; var n=prompt(''Enter a number''); for(a=2;a<=n;a++) { document.write(res); res+=a; } </script> </body> </html>
14th Mar 2017, 11:56 AM
N.Neeharika Reddy
N.Neeharika Reddy - avatar
+ 2
In java class Myprogram { public static void main(String args[]) { int a=0,res=0; for(a=2;a<7;a++) { System.out.println(res); res+=a; } } } If you want to print until some 'n' number then you can import java.util and java.io and take input of some number and print until it
14th Mar 2017, 11:46 AM
N.Neeharika Reddy
N.Neeharika Reddy - avatar
+ 1
no, i mean 0 2 5 9 14 20 27 -------up to desired n
14th Mar 2017, 11:35 AM
Abdus Samad
Abdus Samad - avatar
+ 1
that's fine
14th Mar 2017, 11:36 AM
Abdus Samad
Abdus Samad - avatar
+ 1
thnx bro
15th Mar 2017, 2:01 AM
Abdus Samad
Abdus Samad - avatar