+ 3
how to write a series of increasing cmmndiff with a cmmndiff 1 upto 7 terms starting from 0.
write an Ap
8 Answers
+ 11
did you mean like this?
0
1
2
3
4
5
6
7
?
+ 11
hmmm. i am sory i don't know
+ 3
According to me it will fulfil your requirements
+ 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>
+ 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
+ 1
no, i mean
0
2
5
9
14
20
27
-------up to desired n
+ 1
that's fine
+ 1
thnx bro