Program: Find the sum of the following series using BlueJ.
x/2!+x/4!+x/6!+....n terms
class BlueJS
{
public void show(int x,int n)
{
double sum=0;
int f;
for(int i=2; i< =n; i=i+2)
{
f=fact(i);
sum=sum+(double)x/f;
}
System.out.println("Sum of the series=" + sum);
}
{
int f=1;
for( int i=2 ; i< = n; i++)
{
f=f*i;
}
return f;
}
}
Back To BlueJ Series Display Programs Home Page: CLICK HERE
i'm so sorry...der has been an error from my side in typing in the patterns...they should be something lyk:
ReplyDelete--------------1----------
-------------333---------
------------55555--------
-----------7777777-------
----------999999999------
-----------7777777-------
------------55555--------
-------------333---------
--------------1----------
i'm so sorry..there has been an error on my side while typing in the patern..it should be somehing luk:
ReplyDelete------------1--------
-----------2_2-------
----------3_3_3------
---------4_4_4_4------
--------5_5_5_5_5-----
---------4_4_4_4------
----------3_3_3-------
-----------2_2--------
------------1----------
THE UNDERSCORES REPRESENT "SPACES".
i would also appreciate it if you could
explain to me the logic behind the program.
pls can you help me print da following pattern:
ReplyDelete-----------1234567--------
------------23456--------
-------------345----------
--------------4-----------
-------------345----------
------------23456---------
-----------1234567---------
can you pls help me write a program to print the multiplication table from 11-15
ReplyDeletecan anyone pls help me write da following programs:
ReplyDelete1) write a program to print the prime numbers from 2 to 100.
2)write a program to find the largest even number and smallest odd number from a list of
'n' numder of terms given by the user and indicates the number of numerals to be accepted.
3)write a program to display all square numbers between 5 to 100.
5)write a pragram to display the prime palindromes existing in the range of 100-500.
can anyone pls help me wid this '*' pattern:
ReplyDelete--------*****--------
--------*----*---------
--------*----*--------
--------*****--------
pls help
ReplyDelete............*..........
...........***.........
..........*****........
.........*******.......
..........*****........
...........***.........
............*..........
can some one pls help:
ReplyDelete-------------0----------
------------101---------
---------- 21012--------
----------3210123-------
You will get the answer in my next post
ReplyDeleteneed help for dis pattern:
ReplyDelete----------********---------
----------***--***----------
----------**----**---------
----------*------*---------
----------**----**----------
----------***--***----------
----------********----------
for all the patterns, wait for my next posting.
ReplyDeletePlease make a program for this pattern too-
ReplyDeleteabcdcba
abc cba
ab ba
a a
ab ba
abc cba
abcdcba
class Pat
ReplyDelete{
int i,j,x,k,n=-1;
void show()
{
for(i=0;i<4;i++)
{
x=97;
for(j=0;j<4-i;j++)
{
System.out.print((char)x);
x++;
}
if(i==0)
x=x-1;
for(k=0;k=97)
System.out.print((char)x);
}
System.out.println();
}
n=3;
for(i=1;i<4;i++)
{
x=97;
for(j=0;j<=i;j++)
{
System.out.print((char)x);
x++;
}
if(i==3)
x=x-1;
for(k=0;k=97)
System.out.print((char)x);
}
System.out.println();
}
}
public static void main(String args[])
{
Pat ob=new Pat();
ob.show();
}
}
i want for dis pattern
ReplyDeleteMORAL
MORA
MOR
MO
M
class Pat
ReplyDelete{
String str="MORAL";
int i,j,len;
void show()
{
len=str.length();
for(i=0;i<len;i++)
{
for(j=0;j<len-i;j++)
{
System.out.print(str.charAt(j));
}
System.out.println();
}
}
public static void main(String args[])
{
Pat ob=new Pat();
ob.show();
}
}
plz help
ReplyDelete1
21
321
4321
54321
class Sum
Delete{
public void show()
{
int i,j,x=1,y;
for(i=0;i<5;i++)
{
y=x;
for(j=0;j<=i;j++)
{
System.out.print(y--);
}
x++;
System.out.println();
}
}
}
plz help
ReplyDelete1
2 3
4 5 6
7 8 9 10
class A
Delete{
int i,j,x=1;
void show()
{
for(i=0;i<4;i++)
{
for(j=0;j<=i;j++)
{
System.out.print(x+" ");
x++;
}
System.out.println();
}
}
}
There are two programs. can any body answer?
ReplyDelete1
1 0
1 0 1
1 0 1 0
1 0 1 0 1
and
1 2 3 4 5 6 7
1 2 3 4 5
1 2 3
1