Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
-
Economics & Finance
Articles by Chandu yadav
Page 26 of 81
C# Queryable LongCount Method
Use the Linq LongCount method to get the count of elements.The following is our string array −string[] emp = { "Jack", "Mark"};Now, use the LongCount() method.emp.AsQueryable().LongCount();Here is the complete code.Exampleusing System; using System.Collections.Generic; using System.Linq; class Demo { static void Main() { string[] emp = { "Jack", "Mark"}; long res = emp.AsQueryable().LongCount(); Console.WriteLine("{0} employees in the Department", res); } }Output2 employees in the Department
Read MoreBootstrap .btn-block class
To create a button using the .btn-block class, you can try to run the following code −Example Bootstrap Example The following are block level buttons: Block level Primary button Block level button
Read MoreC# Program to filter array elements based on a predicate
Set an array.int[] arr = { 40, 42, 12, 83, 75, 40, 95 };Use the Where clause and predicate to get elements above 50.IEnumerable myQuery = arr.AsQueryable() .Where((a, index) => a >= 50);Let us see the complete code −Exampleusing System; using System.Linq; using System.Collections.Generic; public class Demo { public static void Main() { int[] arr = { 40, 42, 12, 83, 75, 40, 95 }; Console.WriteLine("Array:"); foreach (int a in arr) { Console.WriteLine(a); } // getting elements above 70 IEnumerable myQuery = arr.AsQueryable() .Where((a, index) => a >= 50); Console.WriteLine("Elements above 50...:"); foreach (int res in myQuery) { Console.WriteLine(res); } } }OutputArray: 40 42 12 83 75 40 95 Elements above 50...: 83 75 95
Read MoreBootstrap .radio-inline class
Use .radio-inline class to a series of radios for controls to appear on the same line. You can try to run the following code to implement the radio-inline class in Bootstrap −Example Bootstrap Forms Best Porgraming Language Java C C++
Read MoreWhat does the interface ICloneable do in C#?
The ICloneable interface creates a copy of the exisiting object i.e a clone.It only has a single method −Clone() − The clone() method creates a new object that is a copy of the current instance.The following is an example showing how to perform cloning using Icloneable interface −Exampleusing System; class Car : ICloneable { int width; public Car(int width) { this.width = width; } public object Clone() { return new Car(this.width); } public override string ToString() { return string.Format("Width of car ...
Read MoreC# Program to perform Currency Conversion
Let’s say you need to get the value of 10 dollars in INR.Firstly, set the variables: double usd, inr, val;Now set the dollars and convert it to INR.// how many dpllars usd = 10; // current value of US$ val = 69; inr = usd * val;Let us see the complete code −Exampleusing System; namespace Demo { public class Program { public static void Main(string[] args) { Double usd, inr, val; // how many dpllars usd = 10; // current value of US$ val = 69; inr = usd * val; Console.WriteLine("{0} Dollar = {1} INR", usd, inr); } } }Output10 Dollar = 690 INR
Read MoreModular multiplicative inverse in java
The java.math.BigInteger.modInverse(BigInteger m) returns a BigInteger whose value is (this-1 mod m). Using this method you can calculate Modular multiplicative inverse for a given number.Programimport java.math.*; public class BigIntegerDemo { public static void main(String[] args) { // create 3 BigInteger objects BigInteger bi1, bi2, bi3; // create a BigInteger exponent BigInteger exponent = new BigInteger("2"); bi1 = new BigInteger("7"); bi2 = new BigInteger("20"); // perform modPow operation on bi1 using bi2 and exp bi3 = bi1.modPow(exponent, bi2); String str = bi1 + "^" +exponent+ " mod " + bi2 + " is " +bi3; // print bi3 value System.out.println( str ); } }Output7^2 mod 20 is 9
Read MoreBootstrap Grid for multiple devices
The following is an example showing the usage of Grid for multiple devices −Example Bootstrap Example Hello, world! Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut ...
Read MoreBootstrap .pagination class
Use the .pagination class to get the pagination on your page.You can try to run the following code to implement the .pagination class −Example Bootstrap Example Coding Examples The following are the examples: « Code1 Code2 Code3 »
Read MoreSet Column Ordering in Bootstrap
Write the columns in an order, and show them in another one. You can easily change the order of built-in grid columns with .col-md-push-* and .col-md-pull-*modifier classes where * range from 1 to 11.Example Bootstrap Example Heading Before Ordering I am on left I am on right After Ordering I was on left I was on right
Read More