Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Server Side Programming Articles - Page 1930 of 2646
862 Views
In this tutorial, we will be discussing a program to convert the ASCII value sentence to its equivalent string.For this we will be provided with a string containing the ASCII codes. Our task is to convert the given string into the equivalent characters and print it back.Example Live Demo#include using namespace std; //converting the ASCII sequence into //character string void convert_ASCII(string str, int len){ int num = 0; for (int i = 0; i < len; i++) { //appending the current digit num = num * 10 + (str[i] - '0'); //checking if number is within range if (num >= 32 && num
283 Views
In this tutorial, we will be discussing a program to convert the array such that the GCD of the array becomes one.For this we will be provided with an array and a positive integer k. Our task is to convert the array elements such that the GCD of elements is 1 while only dividing the array elements by k any number of times until the element is less than k.Example Live Demo#include using namespace std; //calculating the GCD of array int calculate_gcd(int* arr, int n){ int gcd = arr[0]; for (int i = 1; i < n; i++) ... Read More
285 Views
In this tutorial, we will be discussing a program to convert ternary expression to a binary tree.For this we will be provided with a ternary expression. Our task is to convert the given expression in the form of a binary tree depending upon the various paths(choices) possible.Example Live Demo#include using namespace std; //node structure of tree struct Node { char data; Node *left, *right; }; //creation of new node Node *newNode(char Data){ Node *new_node = new Node; new_node->data = Data; new_node->left = new_node->right = NULL; return new_node; } //converting ternary expression into binary tree Node ... Read More
1K+ Views
In this tutorial, we will be discussing a program to convert string into Binary sequence.For this we will be provided with a string of characters. Our task is to convert each of the character into its binary equivalent and print it out spaced between for different characters.Example Live Demo#include using namespace std; //converting into binary equivalent void convert_binary(string s){ int n = s.length(); for (int i = 0; i 0){ (val % 2)? bin.push_back('1') : bin.push_back('0'); val /= 2; } reverse(bin.begin(), bin.end()); cout
329 Views
In this tutorial, we will be discussing a program to convert a singly linked list into XOR linked list.For this we will be provided with a singly linked list. Our task is to take the elements of that list and get it converted into a XOR linked list.Example Live Demo#include using namespace std; //node structure of linked list struct Node { int data; struct Node* next; }; //creation of new node Node* newNode(int data){ Node* temp = new Node; temp->data = data; temp->next = NULL; return temp; } //printing singly linked list void print(Node* ... Read More
602 Views
In this tutorial, we will be discussing a program to convert a singly linked list into circular linked list.For this we will be provided with a singly linked list. Our task is to take the elements of that list and get it converted into a circular linked list.Example Live Demo#include //node structure of linked list struct Node { int data; struct Node* next; }; //converting singly linked list //to circular linked list struct Node* circular(struct Node* head){ struct Node* start = head; while (head->next != NULL) head = head->next; //assigning start to ... Read More
777 Views
In this tutorial, we will be discussing a program to convert min heap to max heap.For this we will be provided with the array representation of the min heap. Our task is to convert that given min heap to max heap in O(n) time complexity.Example Live Demo#include using namespace std; //converting a given subtree into a heap void convert_arrayheap(int arr[], int i, int n){ int l = 2*i + 1; int r = 2*i + 2; int largest = i; if (l < n && arr[l] > arr[i]) largest = l; if (r ... Read More
2K+ Views
In this tutorial, we will be discussing a program to convert hexadecimal value string to ASCII value string.For this we will be provided with a string with some hexadecimal values. Our task is to get that hexadecimal value and convert it into equivalent ASCII values.Example Live Demo#include using namespace std; string convert_ASCII(string hex){ string ascii = ""; for (size_t i = 0; i < hex.length(); i += 2){ //taking two characters from hex string string part = hex.substr(i, 2); //changing it into base 16 char ch ... Read More
625 Views
PHP is a server-side scripting language designed for web development but also used as a general-purpose programming language. Originally created by Rasmus Lerdorf in 1994, the PHP reference implementation is now produced by The PHP Group. The latest version PHP is PHP7 and it provides 2x faster performance and 50% better memory consumption than PHP version 5.6. This article explains “How to install PHP7 on Ubuntu Linux”.Before installing PHP7, you should need to install a PPA called ondrej/php. This allows you to co-install PHP versions 5.6 and 7.0.Configuring a PPA for co-installable PHP 5.6 + 7.0To configure a PPA, use ... Read More
344 Views
In this tutorial, we will be discussing a program to convert given time into words. For this we will be provided with a specific time in the digital format.Our task is to convert that particular time into wordsExample#include using namespace std; //printing time in words void convert_time(int h, int m){ char nums[][64] = { "zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "ten", "eleven", "twelve", "thirteen", "fourteen", "fifteen", "sixteen", "seventeen", "eighteen", "nineteen", "twenty", "twenty one", ... Read More