Generate the First 100 Even Numbers Using C#

karthikeya Boyini
Updated on 22-Jun-2020 07:24:40

3K+ Views

To generate first 100 even numbers, set a for loop from 1 to 100.for(val = 1; val

Write a C# Program to Find GCD and LCM

Ankith Reddy
Updated on 22-Jun-2020 07:24:03

1K+ Views

GCD (Greatest Common Divisor)GCD is the largest positive integer that divides each of the integers.LCM (Least Common Multiple)LCM of two numbers is the smallest integer divisible by both the numbers.The following is an example to calculate the GCD and LCM. Here, we are calculating the LCM and GCD of 10 and 16 −Example Live Demousing System; using System.Collections.Generic; using System.Linq; using System.Text; namespace Demo {    class Program {       static void Main(string[] args) {          int val1, val2, n1, n2, x;          int resLCM, resGCD;          val1 ... Read More

Special Security Requirements for Stored Procedures and Replication

radhakrishna
Updated on 22-Jun-2020 07:23:52

271 Views

Actually, a MySQL slave server has the authority to execute any statement read from a master's MySQL server binary log, hence some special security constraints exist for using stored functions with replication. If replication or binary logging in general (for the purpose of point-in-time recovery) is active, then MySQL DBAs have two security options open to them −Option of SUPER privilegeAny user wishing to create stored functions must be granted the SUPER privilege by DBA.log_bin_trust_function_creators modeActually, log_bin_trust_function_creators enables anyone with the standard CREATE ROUTINE privilege to create stored functions hence a DBA can set the log_bin_trust_function_creators system variable to 1.Read More

Output of CONCAT Function with NULL in String Linking

Chandu yadav
Updated on 22-Jun-2020 07:22:58

141 Views

MySQL CONCAT() function will return a NULL if you will add a NULL value while linking two strings. Following example will demonstrate it −Examplemysql> Select CONCAT('Tutorials',NULL,'Point'); +----------------------------------+ | CONCAT('Tutorials',NULL,'Point') | +----------------------------------+ | NULL                             | +----------------------------------+ 1 row in set (0.06 sec) mysql> Select CONCAT('TutorialsPoint','.com',NULL); +--------------------------------------+ | CONCAT('TutorialsPoint','.com',NULL) | +--------------------------------------+ | NULL                                 | +--------------------------------------+ 1 row in set (0.00 sec)

Difference Between String Copy and String CopyTo Methods in C#

Arjun Thakur
Updated on 22-Jun-2020 07:22:38

385 Views

String.CopyTo() method gets the string characters and places them into an array. A group of characters are copied from source string into a character array.The following is the Copy() method −Example Live Demousing System; class Demo {    static void Main(String[] args) {       string str = "This is it!";       char[] ch = new char[5];       str.CopyTo(2, ch, 0, 2);       Console.WriteLine("Output...");       Console.WriteLine(ch);    } }OutputOutput... isString.Copy() creates a new string object with similar content.Example Live Demousing System; class Demo {    static void Main(String[] args) { ... Read More

What is Method Hiding in C#

karthikeya Boyini
Updated on 22-Jun-2020 07:22:06

2K+ Views

Method hiding is also known as shadowing. The method of the parent class is available to the child class without using the override keyword in shadowing. The child class has its own version of the same function.Use the new keyword to perform shadowing.Let us see an example.Example Live Demousing System; using System.Collections.Generic; class Demo {    public class Parent {       public string GetInfo () {          return "This is Parent Class!";       }    }    public class Child : Parent {       public new string GetInfo() {   ... Read More

Create a Procedure to Find Out the Factorial of a Number

vanithasree
Updated on 22-Jun-2020 07:21:33

4K+ Views

It can be created with the help of the following query −mysql> Delimiter // mysql> CREATE PROCEDURE fact(IN x INT)     -> BEGIN     -> DECLARE result INT;     -> DECLARE i INT;     -> SET result = 1;     -> SET i = 1;     -> WHILE i SET result = result * i;     -> SET i = i + 1;     -> END WHILE;     -> SELECT x AS Number, result as Factorial;     -> END// Query OK, 0 rows affected (0.17 sec)Now when invoking this ... Read More

Create a Bordered List Without Bullets Using CSS

Arjun Thakur
Updated on 22-Jun-2020 07:21:10

331 Views

To create a bordered list without bullets, you can try to run the following code. The list-style-type is set to none to remove bullets to a listExampleLive Demo                    ul {             background-color: orange;             padding: 10px 20px;             list-style-type: none;             border: 2px solid black;          }                     Countries                India          US          Australia           Output

What is Static Binding in C#

Samual Sam
Updated on 22-Jun-2020 07:21:02

1K+ Views

The linking of a function with an object during compile time is called static binding. C# provides two techniques to implement static polymorphism: Function overloading and Operator overloading.In Function Overloading, you can have multiple definitions for the same function name in the same scope.Examplevoid print(int i) {    Console.WriteLine("Printing int: {0}", i ); } void print(double f) {    Console.WriteLine("Printing float: {0}" , f); }Overloaded operators are functions with special names. The keyword operator IS followed by the symbol for the operator being defineD.Examplepublic static Box operator+ (Box b, Box c) {    Box box = new Box();   ... Read More

Create MySQL Stored Procedures Without BEGIN and END

Vrundesha Joshi
Updated on 22-Jun-2020 07:20:52

583 Views

We can create MySQL stored procedures without ‘BEGIN’ and ‘END’ just in the same way created with both of them only thing is to omit to BEGIN and END. In the following example, we are creating a stored procedure without ‘BEGIN’ and ‘END’ to get all the rows from a table −Examplemysql> Delimiter // mysql> CREATE PROCEDURE Hello()     -> SELECT * from Student_info; // Query OK, 0 rows affected (0.08 sec)We can see MySQL created stored procedures without BEGIN and END. Now invoke this by CALL statement −mysql> Delimiter ; mysql> CALL Hello(); +-----+---------+------------+------------+ | id  | ... Read More

Advertisements