Saved Bookmarks
| 1. |
Write a program in java to display all the three digit prime number |
|
Answer» //Program to print all prime numbers from 100 to 999. class abc{ public static void main (STRING ar []){ for(INT I=100;I<=999;I++){ int c=0; for(int j=1;j<=I;j++) if(i%j==0) c++; if(c==2) System.out.println(I+" is a prime number");}}}
Hope this will help you. |
|