Write the program to generate the following series
i 1,4,9,16,25------------------------------ up to 10 terms
ii 2,9,28,65,126,--------------------------up to 10 terms
ritzdas:
May I know what type of program you want?
Answers
Answered by
24
i) 10 for i = 1 to 10
20 print i * i
30 next i
---------------------
ii) The logic used for next problem is
1^3+1=2
2^3+1=9
3^3+1=28
4^3+1=65
5^3+1=126
6^3+1=217
7^3+1=344
8^3+1=513
9^3+1=730
10^3+1=1001
20 print i * i
30 next i
---------------------
ii) The logic used for next problem is
1^3+1=2
2^3+1=9
3^3+1=28
4^3+1=65
5^3+1=126
6^3+1=217
7^3+1=344
8^3+1=513
9^3+1=730
10^3+1=1001
Answered by
10
i)
class Pattern
{
void main()
{
for(int i=1; i<=10; i++)
{
System.out.println(Math.pow(i,2));
}
}
}
ii)
class Pattern
{
void main()
{
for(int i=1; i<=10; i++)
{
System.out.println(Math.pow(i,3)+1);
}
}
}
class Pattern
{
void main()
{
for(int i=1; i<=10; i++)
{
System.out.println(Math.pow(i,2));
}
}
}
ii)
class Pattern
{
void main()
{
for(int i=1; i<=10; i++)
{
System.out.println(Math.pow(i,3)+1);
}
}
}
Similar questions