Tuesday, June 29, 2010

Prime Number Program Source Code

Prime Number Program Source Code
<html>  
<head><TITLE></TITLE>  
<script language="JavaScript">  
var a=prompt("enter a value");  
alert(a);  
var c=0;  
  
 for(var i=2;i<a;i++)  
  {  
   if(a%i==0)  
   {  
    c=i;  
    //alert("Now C IS:"+c);  
   }  
  }  
  if(c==0)  
  {  
   alert("given no is prime");  
  }  
  else  
  {  
   alert("given no is not a prime");  
  }  
</script>  
</head>  
<body></body>  
</html>  
}
 

--
http://www.venkatmails.blogspot.com/

Venkat Mails, Fun , Cool pictures, Fun messages, Sardar Jokes, Quotations Moral stories Fun stories

http://www.venkatmails.blogspot.com/

7 comments:

  1. This comment has been removed by the author.

    ReplyDelete
  2. if(c==0)
    this should be replaced by
    if(c==a)

    ReplyDelete
  3. Presently engineers simply needed to program to a couple working frameworks approving it took a shot at them.Java

    ReplyDelete
  4. Prime numbers are a special kind of natural numbers or positive integers which are exactly
    divisible by 1 and the number itself or such as 2,3,5,7 and 11.

    ReplyDelete


  5. prime number distribution . (PNDS), developed by the NSI team of mathematicians2 which computes the exact count of primes numbers.

    ReplyDelete