php using prime number program for($i=2;$i<50;$i++){ $counter=0; for($j=2;$j<$i;$j++){ if($i%$j==0){ $counter++; break; } } // you can check instead if($i==$j) if($counter==0){ echo $i.","; } }
As you can see in our last example there are tons of different formats that can be used in the date feature. Below is a summary of the variable used in date, and what each does. Remember they ARE CaSe sEnsItIVe: DAYS d - day of the month 2 digits (01-31) j - day of the month (1-31) D - 3 letter day (Mon - Sun) l - full name of day (Monday - Sunday) N - 1=Monday, 2=Tuesday, etc (1-7) S - suffix for date (st, nd, rd) w - 0=Sunday, 1=Monday (0-6) z - day of the year (1=365) WEEK W - week of the year (1-52) MONTH F - Full name of month (January - December) m - 2 digit month number (01-12) n - month number (1-12) M - 3 letter month (Jan - Dec) t - Days in the month (28-31) YEAR L - leap year (0 no, 1 yes) o - ISO-8601 year number (Ex. 1979, 2006) Y - four digit year (Ex. 1979, 2006) y - two digit year (Ex. 79, 06) TIME a - am or pm A - AM or PM B - Swatch Internet time (...
Android Interview Questions and Answers Describe Android Application Architecture. Android Application Architecture has the following components: • Services – like Network Operation • Intent – To perform inter-communication between activities or services • Resource Externalization – such as strings and graphics • Notification signaling users – light, sound, icon, notification, dialog etc. • Content Providers – They share data between applications Describe a real time scenario where android can be used? Imagine a situation that you are in a country where no one understands the language you speak and you can not read or write. However, you have mobile phone with you. With a mobile phone with android, the Google translator translates the data of one language into another language by using XMPP to transmit data. You can type the message in English and select the language which is understood by the citizens of the country in order to reach the message to the citizens. What’s the difference ...
SOAP Pros: · Langauge, platform, and transport agnostic · Designed to handle distributed computing environments · Is the prevailing standard for web services, and hence has better support from other standards (WSDL, WS-*) and tooling from vendors · Built-in error handling (faults) · Extensibility Cons: · Conceptually more difficult, more "heavy-weight" than REST · More verbose · Harder to develop, requires tools REST Pros: · Language and platform agnostic · Much ...
Comments
Post a Comment