Found 34494 Articles for Programming

C++ Program to Solve any Linear Equation in One Variable

Arjun Thakur
Updated on 25-Jun-2020 08:51:00

5K+ Views

Any linear equation in one variable has the form aX + b = cX + d. Here the value of X is to be found, when the values of a, b, c, d are given.A program to solve a linear equation in one variable is as follows −Example Live Demo#include using namespace std; int main() {    float a, b, c, d, X;    coutd;    cout

C++ Program to Implement Queue using Linked List

Chandu yadav
Updated on 25-Jun-2020 09:00:06

23K+ Views

A queue is an abstract data structure that contains a collection of elements. Queue implements the FIFO mechanism i.e the element that is inserted first is also deleted first. In other words, the least recently added element is removed first in a queue.A program that implements the queue using linked list is given as follows −Example#include using namespace std; struct node {    int data;    struct node *next; }; struct node* front = NULL; struct node* rear = NULL; struct node* temp; void Insert() {    int val;    coutdata = val;       front = rear; ... Read More

C++ Program to Implement Queue using Array

George John
Updated on 02-Sep-2023 13:07:21

70K+ Views

A queue is an abstract data structure that contains a collection of elements. Queue implements the FIFO mechanism i.e., the element that is inserted first is also deleted first. In other words, the least recently added element is removed first in a queue.A program that implements the queue using an array is given as follows −Example#include using namespace std; int queue[100], n = 100, front = - 1, rear = - 1; void Insert() {    int val;    if (rear == n - 1)    cout

number_format() function in PHP

Samual Sam
Updated on 26-Dec-2019 07:21:15

238 Views

The number_format() function is used to format a number with grouped thousands.Syntaxnumber_format(num,decimals,decimal_pt,separator)Parametersnum − The number to be formatted.decimals − Specifies how many decimals.decimal_pt − The string to be used for decimal point.separator − Specifies the string to be used for thousands separator.ReturnThe number_format() function returns the formatted number.ExampleThe following is an example − Live DemoOutputThe following is the output −10,000,000ExampleLet us see another example − Live DemoOutputThe following is the output −4,000

nl_langinfo() function in PHP

karthikeya Boyini
Updated on 30-Jul-2019 22:30:23

39 Views

The nl_langinfo() function has contained information about language and locale. Note − This function won’t work on Windows. Syntax nl_langinfo(ele) Parameters ele − Specify what element to return. Should be any of the following elements − Time and Calendar − ABDAY_(1-7) - Abbreviated name of the numbered day of the week DAY_(1-7) - Name of the numbered day of the week (DAY_1 = Sunday) ABMON_(1-12) - Abbreviated name of the numbered month of the year MON_(1-12) - Name of the numbered month of the year AM_STR - String for Ante meridian PM_STR - String for Post ... Read More

explode() function in PHP

Samual Sam
Updated on 24-Jun-2020 13:28:14

252 Views

The explode() function is used to split a string by string.Syntaxexplode(delimiter, str, limit)Parametersdelimiter − The boundary stringstr − String to splitlimit − Specifies the number of array elements to return.The following are possible values −Greater than 0 - Returns an array with a maximum of limit element(s)Less than 0 - Returns an array except for the last -limit elements()0 - Returns an array with one elementReturnThe explode() function returns an array of strings.The following is an example −Example Live DemoThe following is the output −OutputArray (    [0] => This    [1] => is    [2] => demo    [3] => ... Read More

convert_cyr_string() function in PHP

karthikeya Boyini
Updated on 30-Jul-2019 22:30:23

37 Views

The convert_cyr_string() function is used to convert from one Cyrillic character set to another. The supported Cyrillic character-sets are − k - koi8-r w - windows-1251 i - iso8859-5 a - x-cp866 d - x-cp866 m - x-mac-cyrillic Syntax convert_cyr_string(str, from, to) Parameters str − String to format from − The source Cyrillic character set, as a single character. to − The destination Cyrillic character set, as a single character. Return The convert_cyr_string() function returns the converted string. The following is an example − Example Live Demo ... Read More

timezone_name_get() function in PHP

Samual Sam
Updated on 24-Dec-2019 10:22:52

20 Views

The timezone_name_get() function returns the name of the timezone.Syntaxtimezone_name_get(obj)Parametersobj − A DateTimeZone object.ReturnThe timezone_name_get() function returns array on success or FALSE on failure.ExampleThe following is an example − Live DemoOutputThe following is the output −Europe/Paris

date_time_set() function in PHP

Samual Sam
Updated on 24-Dec-2019 08:43:08

33 Views

The date_time_set() function sets the time. It returns a DateTime object on success. FALSE on failure.Syntaxdate_time_set(obj, hour, minute, second)Parametersobj − DateTime objecthour − Hour of the time to setminute − Minute of the time to setsecond − Second of the time to setReturnThe date_time_set() function returns a DateTime object on success. FALSE on failure.ExampleThe following is an example − Live DemoOutputThe following is the output −2018-09-05 08:15:00ExampleLet us see another example − Live DemoOutputThe following is the output −2017-08-08 13:24:00

call_user_method() function in PHP

Ankith Reddy
Updated on 30-Jul-2019 22:30:23

100 Views

The call_user_method() function call a user method on an specific object. Note − The function is deprecated now. Syntax call_user_method(method, obj, params) Parameters method − Method name obj − Object that method is being called on. params − Array of parameters Alternative Since the call_user_method() deprecated in PHP 4.1.0, and removed in PHP 7.0, therefore use the following as an alternative solution − call_user_func(array($obj, $method), $params);

Advertisements