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 2055 of 2650
2K+ Views
The TimeSpan.FromMinutes() method in C# is used to return a TimeSpan that represents a specified number of minutes, where the specification is accurate to the nearest millisecond.Syntaxpublic static TimeSpan FromMinutes (double val);Above, the value val is the number of minutes, accurate to the nearest millisecond.Example Live Demousing System; public class Demo { public static void Main() { TimeSpan span1 = TimeSpan.FromHours(0.78787); TimeSpan span2 = new TimeSpan(10, 30, 40); TimeSpan span3 = TimeSpan.FromHours(5); TimeSpan span4 = TimeSpan.FromMilliseconds(1); TimeSpan span5 = TimeSpan.FromMinutes(100); Console.WriteLine("TimeSpan1 = ... Read More
8K+ Views
The String.Contains() method in C# is used to return a value indicating whether a specified substring occurs within this string.Syntaxpublic bool Contains (string val);Above, val is the string to search for.Example Live Demousing System; public class Demo { public static void Main(String[] args) { string str1 = "Akon"; string str2 = "Ak"; Console.WriteLine("String 1 = "+str1); Console.WriteLine("HashCode of String 1 = "+str1.GetHashCode()); Console.WriteLine("String 2 = "+str2); Console.WriteLine("HashCode of String 2 = "+str2.GetHashCode()); Console.WriteLine("String 1 is equal to String 2: ... Read More
986 Views
In this tutorial, we will be discussing a program to implement t-test.The t-test of the student’s T test is used to compare two means and tell if both of them are similar or different. Along with this, t-test also helps to determine how large the differences are to know the reason for the change.Example#include using namespace std; //calculating mean float calc_mean(float arr[], int n){ float sum = 0; for (int i = 0; i < n; i++) sum = sum + arr[i]; return sum / n; } //calculating standard deviation float calc_deviation(float arr[], ... Read More
289 Views
In this tutorial, we will be discussing a program to implement standard error of mean.Standard error of mean is the estimation of sample mean dispersion from population mean. Then it is used to estimate the approximate confidence intervals for the mean.Example#include using namespace std; //calculating sample mean float calc_mean(float arr[], int n){ float sum = 0; for (int i = 0; i < n; i++) sum = sum + arr[i]; return sum / n; } //calculating standard deviation float calc_deviation(float arr[], int n){ float sum = 0; for (int i = ... Read More
311 Views
In this tutorial, we will be discussing a program to implement Run Length Encoding using Linked Lists.For this we will be given with a linked list. OUr task is too encode the elements of the Linked List using Run Length Encoding.For example, if the elements of the linked list are “a->a->a->a->a” then in run length encoding they will be replaced by “a → 5”.Example#include using namespace std; //structuring linked list node struct Node { char data; struct Node* next; }; //creating a new node Node* newNode(char data){ Node* temp = new Node; temp->data = data; ... Read More
379 Views
In this tutorial, we will be discussing a program to implement standard deviation of grouped data.For this we will be given with class interval and frequency of the class. Our task is to find the standard deviation of the grouped data.Example#include using namespace std; //finding mean of grouped data float calc_mean(float mid[], int freq[], int n){ float sum = 0, freqSum = 0; for (int i = 0; i < n; i++) { sum = sum + mid[i] * freq[i]; freqSum = freqSum + freq[i]; } return sum / ... Read More
1K+ Views
In this tutorial, we will be discussing a program to implement SImpson’s ⅜ rule.Simpson’s ⅜ rule is used for doing numerical integrations. The most common use case of this method is in performing numerical approximations of definite integrals.In this, the parabolas on the graph are used for performing the approximations.Example#include using namespace std; //function that is to be integrated float func_inte( float x){ return (1 / ( 1 + x * x )); } //calculating the approximations float func_calculate(float lower_limit, float upper_limit, int interval_limit ){ float value; float interval_size = (upper_limit - lower_limit) / interval_limit; float ... Read More
623 Views
The Stack.TrimExcess() method in C# is used to set the capacity to the actual number of elements in the List, if that number is less than a threshold value.Syntaxpublic void TrimExcess ();Example Live Demousing System; using System.Collections.Generic; public class Demo { public static void Main() { Stack stack = new Stack(); stack.Push(100); stack.Push(150); stack.Push(175); stack.Push(200); stack.Push(225); stack.Push(250); stack.Push(300); stack.Push(400); stack.Push(450); stack.Push(500); Console.WriteLine("Elements in the ... Read More
932 Views
In this tutorial, we will be discussing a program to implement Linear Extrapolation.Extrapolation is defined as a process in which the required value for a certain function is beyond the lower or the upper limits of the function definition.In the case of Linear Extrapolation, the value beyond the scope is found using the tangent made on the graph of the function to determine the required value. Linear Extrapolation gives quite accurate results when applied.Example#include using namespace std; //structuring the values of x and y struct Data { double x, y; }; //calculating the linear extrapolation double calc_extrapolate(Data d[], ... Read More
443 Views
In this tutorial, we will be discussing a program to implement Inverse Interpolation using Lagrange formula.Inverse Interpolation is defined as the method of finding the value of an independent variable from the given value of dependent value lying between two tabulated set of values for an unknown function.Example#include using namespace std; //structuring the values of x and y struct Data { double x, y; }; //calculating inverse interpolation double calc_invinter(Data d[], int n, double y){ double x = 0; int i, j; for (i = 0; i < n; i++) { double ... Read More