Posts

Top Posts

javascript arrow function

 JavaScript arrow function let func1 = ( a , b ) => console . log ( a * b ); //arrow function func1 ( 2 , 4 ); hello = () => {     return "eswar" ; } //arrow functin using brackets and return console . log ( hello ()); hello1 = () => "hello all" ; //arrrow function withour using the bracket and return console . log ( hello1 ()); hello2  = ( a ) => "apcfss " + a ; // arrow function with parameters console . log ( hello2 ( 2.334 )); hello3 = a => "hello " + a ; //In fact, if you have only one parameter, you can skip the parentheses as well: console . log ( hello3 ( 23223 )); hello4  = () => console . log ( this ); hello4 ();          

Print first N Fibonacci Numbers in python

Image
Print first N Fibonacci Numbers using Python Programming Language.

Print prime numbers up to N and Check N is prime or not using Java Programming Language

Image
 Print prime numbers up to N and Check N is prime or not using Java Programming Language.   Answer ) Only the number divided by itself and divided by  1 is called as Prime Number. Below code is for check prime for number and also print prime numbers for up to that range(N). Below code is only on Java language. If it is helpful for you , then comment below . If you want below code in python , Click Here

Print prime numbers up to N and Check N is prime or not using Python Programming Language

Image
 Print prime numbers up to N and Check N is prime or not using Python Programming Language.   Answer ) Only the number divided by itself and divided by  1 is called as Prime Number. Below code is for check prime for number and also print prime numbers for up to that range(N). Below code is only on python language. If it is helpful for you , then comment below .   def checkPrime(n):     if(n==0 or n==1 or n<0):         return False     for i in range(2,n):         if(n%i==0):             return False     return True   n = int(input("Enter Numer : ")) if(checkPrime(n)):     print(n," is Prime Number") else:     print(n," is Not Prime Number") print("\nPrime Numbers up to ",n," : " ,end=" ") for i in range(1,n+1):     if(checkPrime(i)):         print(i,end=" ") Picture view:   Output Picture view: