This post has been edited by pbl: 22 January 2009 - 05:18 PM
a program to print prime numbers up to 100 using for loop in javaDuplicated posts. Topics merged
Page 1 of 1
13 Replies - 10880 Views - Last Post: 10 February 2009 - 03:32 AM
#1
a program to print prime numbers up to 100 using for loop in java
Posted 22 January 2009 - 05:29 AM
a program to print prime numbers up to 100 using for loop in java
Replies To: a program to print prime numbers up to 100 using for loop in java
#2
Re: a program to print prime numbers up to 100 using for loop in java
Posted 22 January 2009 - 05:32 AM
1. Write a program to calculate the area of a circle using circle class
2. Write a program to generate Fibonacci series for first 100 numbers
3. Write a program to input an alphabet and check whether it is a vowel or consonant using switch.
4. Write a program that guarantees 25 random int values. For each value, use an if-else statement to classify it is greater than, less than or equal to a second randomly generated value.
5. Write a program to print prime numbers up to 100 using for loop.
6. Write a program to calculate the factorial of n numbers using while loop.
7. Write a program to check a given word is a palindrome or not
8. Write a program to find the smallest and largest from a given set of numbers.
9. Write a program computes the maximum, minimum, and average of n real numbers.
10. Write a Program to find the sum of all numbers between 3 and 60.
11.
Write a program that computes the square root of the number say
The program can also be called with multiple arguments, so that each will have its square root calculated, as in:
sqrt 2 3 4 5
which will return the output:
SQRT(2) = 1.41421
SQRT(3) = 1.73205
SQRT(4) = 2
SQRT(5) = 2.23607
12. Write a program that does Temperature Conversion Using While loop.
13. Write a program to draw basic shapes like circles, ovals, lines, arcs, squares, rectangles, rounded rectangles, and polygons using applets. Fill the shapes with different colours.
14. Write a program to draw a simple text by defining style, font, size and colour. Try it for various dimensions by changing font, size, colour etc.
15. Write a program to read an image and display an image
OOP
2. Write a program to generate Fibonacci series for first 100 numbers
3. Write a program to input an alphabet and check whether it is a vowel or consonant using switch.
4. Write a program that guarantees 25 random int values. For each value, use an if-else statement to classify it is greater than, less than or equal to a second randomly generated value.
5. Write a program to print prime numbers up to 100 using for loop.
6. Write a program to calculate the factorial of n numbers using while loop.
7. Write a program to check a given word is a palindrome or not
8. Write a program to find the smallest and largest from a given set of numbers.
9. Write a program computes the maximum, minimum, and average of n real numbers.
10. Write a Program to find the sum of all numbers between 3 and 60.
11.
Write a program that computes the square root of the number say
The program can also be called with multiple arguments, so that each will have its square root calculated, as in:
sqrt 2 3 4 5
which will return the output:
SQRT(2) = 1.41421
SQRT(3) = 1.73205
SQRT(4) = 2
SQRT(5) = 2.23607
12. Write a program that does Temperature Conversion Using While loop.
13. Write a program to draw basic shapes like circles, ovals, lines, arcs, squares, rectangles, rounded rectangles, and polygons using applets. Fill the shapes with different colours.
14. Write a program to draw a simple text by defining style, font, size and colour. Try it for various dimensions by changing font, size, colour etc.
15. Write a program to read an image and display an image
OOP
#3
Re: a program to print prime numbers up to 100 using for loop in java
Posted 22 January 2009 - 05:42 AM
Show some code to show us what you have. If you have none for a loop to find prime numbers I recommend using the % operator and only test up to half the original number your testing.
#4
Re: a program to print prime numbers up to 100 using for loop in java
Posted 22 January 2009 - 06:12 AM
I don't think you typed "a program to print prime numbers up to 100 using for loop in java" enough times to get a helpful response.
It could be something else though.
[rules][/rules]
It could be something else though.
[rules][/rules]
#5
Re: a program to print prime numbers up to 100 using for loop in java
Posted 22 January 2009 - 07:41 AM
These are all good exercises. Primes are commonly found using the Sieve of Eratosthenes.
[rules][/rules]
By the way, this is not classified as Intermediate, this is definitely beginner stuff.
[rules][/rules]
By the way, this is not classified as Intermediate, this is definitely beginner stuff.
This post has been edited by Gloin: 22 January 2009 - 07:42 AM
#6
Re: a program to print prime numbers up to 100 using for loop in java
Posted 22 January 2009 - 08:07 AM
you gotta be kidding me
#7
Re: a program to print prime numbers up to 100 using for loop in java
Posted 22 January 2009 - 08:15 AM
@dirtydevil, dont expect from us to solve all your homework for you... just be specific in your question, show your effort and code... thanks good luck...
#8
Re: a program to print prime numbers up to 100 using for loop in java
Posted 22 January 2009 - 08:18 AM
So you just decide and post your list of assignments and expect code in return.
NO!!!!
DIC requires good faith effort on your part towards solutions to the problems you have.
NO!!!!
DIC requires good faith effort on your part towards solutions to the problems you have.
#9
Re: a program to print prime numbers up to 100 using for loop in java
Posted 22 January 2009 - 05:15 PM
An you qualify this post as "Intermediate" ???
All your programs are really beginners stuff
And avoid double posting
Topics merged
All your programs are really beginners stuff
And avoid double posting
Topics merged
#10
Re: a program to print prime numbers up to 100 using for loop in java
Posted 22 January 2009 - 09:06 PM
So you just decide and post your list of assignments and expect code in return.
NO!!!!
NO!!!!
#12
Re: a program to print prime numbers up to 100 using for loop in java
Posted 22 January 2009 - 09:27 PM
To check for prime nos u need to divide the nos frm 1 to the nos and check for the remainder....... like
//calculate the area of a circle using circle class
int area;
int radius;
radius=Integer.parse.Int(in.readLine());
area=3.14*radius* radius;
System.out.println(radius);
//. Write a program to input an alphabet and check whether it is a vowel or consonant using switch.
enter the alphabet use
like
char a;
if(a=='a'||a=='e')(this process till U),use ignore case and compare it if the vowel test fails.. Its a constant
Write a program to generate Fibonacci series for first 100 numbers
use a counter vich will run from 0 to 99,and will break after 99 and print the output.Initalize 3 varibles... one will store the value 0 ,2nd one will store the value 1 third one wil store the sum;
store the value of 2nd variable in the first
then store the 3rd variable value in 2nd one ...and print the output.
//calculate the factorial of n
use loop that vil go frm 1-n, and calculate the factorial..
// given word is a palindrome
use reverse fx to chk for palindrome. and
int i=100;
int c=0;
while(i>=100)
{ for(int j=1;j<i;j++)
{ if(i%j==0)
c++;
if(c<=2)
System.out.println(i);
i++;
}
}
//calculate the area of a circle using circle class
int area;
int radius;
radius=Integer.parse.Int(in.readLine());
area=3.14*radius* radius;
System.out.println(radius);
//. Write a program to input an alphabet and check whether it is a vowel or consonant using switch.
enter the alphabet use
like
char a;
if(a=='a'||a=='e')(this process till U),use ignore case and compare it if the vowel test fails.. Its a constant
Write a program to generate Fibonacci series for first 100 numbers
use a counter vich will run from 0 to 99,and will break after 99 and print the output.Initalize 3 varibles... one will store the value 0 ,2nd one will store the value 1 third one wil store the sum;
store the value of 2nd variable in the first
then store the 3rd variable value in 2nd one ...and print the output.
//calculate the factorial of n
use loop that vil go frm 1-n, and calculate the factorial..
// given word is a palindrome
use reverse fx to chk for palindrome. and
#13
Re: a program to print prime numbers up to 100 using for loop in java
Posted 04 February 2009 - 05:17 PM
dirtydevil.....errrrmmm..where's your code?
#14
Re: a program to print prime numbers up to 100 using for loop in java
Posted 10 February 2009 - 03:30 AM
no one is gonna write the code for you in java even i was not helped by the dic they are doing right if we dont intiate something they will not help this site only meant to help those who show that they are also trying and i think this looks like a college assignment and they are not meant to be copied but trying it by yourself
#15
Re: a program to print prime numbers up to 100 using for loop in java
Posted 10 February 2009 - 03:32 AM
I think he gets the idea of the rules... Topic Closed.
Page 1 of 1
|
|

New Topic/Question
This topic is locked




MultiQuote






|