PHP Programming/ Logical Interview questions and answers

9195 0

$1*/ mo hosting! Get going with GoDaddy!


Q 1. Write a program for this pattern ?

 

* * * * * 
* * * * 
* * * 
* * 
*

Answer –

Q2 -Write a program for this pattern ?

*
* *
* * *
* * * *
* * * * *

Answer-

Q3 -Write a program for this pattern ?

*
*  *
*  *  *
*  *  *  *
*  *  *  *  *
*  *  *  *  *  *
*  *  *  *  *
*  *  *  *
*  *  *
*  *
*

Answres-

Q4 -Write a program for this pattern ?

*****
*****
*****
*****
*****

Answer-

Q5- How to find a factorial of a number ?

Answer- 

Q 6- How to find whether a number prime or not ?

Answer-

Q 7- How to find whether a number armstrong or not ?

Answer- An Armstrong number of three digits is an integer such that the sum of the cubes of its digits is equal to the number itself.

For example, 371 is an Armstrong number since 3**3 + 7**3 + 1**3 = 371.

Q 8- How to find  whether a year leap year or not ?

Answer-

Q9 -Write a program for this pattern(number pyramid) ?

1
22
333
4444
55555

Answer-

Q 10- How to print a number reverse ?

Answer –

Q11 – Swap two values without third variable ?

Answer –

In this article

Join the Conversation



Share