Tag: tutorials
C Program to compute Quotient and Remainder
Problem Write a program in C to calculate the quotient and remainder and display it on the screen. How to compute quotient and remainder in C ? Output Enter dividend: 8 Enter divisor: 3 Quotient = 2 Remainder = 2
C Program to display Prime Numbers between two numbers
Problem Write a program in C to display all the prime numbers between a range of 2 numbers. How to display prime numbers between a range of 2 numbers in C ? Output Abundantcode.com coding sample Enter Lower limit :5 Enter Upper limit :20 Prime numbers between 5 and 20 : 5 7 11 13 17 19
Java – How to convert String to Double in Java ?
Problem Statement You want to convert a string value to double in Java. Solution You can use one of the three approaches to convert a string to double in Java. 1. Assigning the string to the constructor of the Double class 2. Using Double.valueOf 3. Using Double.parseDouble The output of the above program is Abundantcode.com Java Tutorials 76.2 String to double using valueOf 76.2 string…
Java – How to read a valid Integer number from Console ?
Problem Statement You need to read a valid integer number from the Console in your java program. If the number is invalid , show appropriate message. Solution To read a valid integer from a console program , you can use the Scanner class and pass the System.in as the parameter to its constructor. The scanner class exposes a method called nextInt() which can be used…
Java – How to convert Long to other primitive numeric data types ?
Problem Statement You need convert a long value to other numeric data types in java. Solution Use the Long wrapper class which exposes methods like byteValue , shortValue , intValue etc. Below is a sample code snipper demonstrating the usage of the same. The output for the above program is Abundantcode.com Java Tutorials 76 76 76.0
Object Initializer in C#
Below is a sample sourecode demonstrating the Object Initializer in C# Object Initializer in C#
Java – How to convert a double value to string ?
Problem Statement You need to convert a double value to string in your java program. Solution Use the toString() method defined in the Double class to convert a double value to string in java. The output of the above program is Abundantcode.com Java Tutorials 25.0
SQL Server 2014 Tutorial – Display System Databases in Object Explorer.
Problem Statement You need to view the System Databases in Object Explorer. Solution By default , there are few System databases that gets created when you install SQL Server. Some of these databases are master – This is the primary system database which is needed for the SQL Server to start and work fine. It contains the information about databases , logins , configurations etc….
C Program to generate multiplication table
Problem Write a program in C to generate a multiplication table of a number entered by the user. How to generate a multiplication table for a input number in C ? Here’s a program that takes an input from the user and generates a multiplication table for it up to 10. Output Abundantcode.com’s Coding sample Enter a Number: 12 12 * 1 = 12 12…
Json.NET & VB.NET – How to Serialize an Collection?
Do you want to serialize an collection in your VB.NET application?. Json.NET supports this functionality with ease. The Collection can be an Array , Dictionary or List. You need to simply pass collection to the JsonConvert.SerializeObject static method which would serialize the collection and return you the Json string. How to Serialize a Collection in VB.NET using Json.NET ? For example , assume that you…
C# Program to swap two numbers
Problem Write a program in C# to swap two numbers using temporary variable and display the result in the console window. How to swap two numbers in C# and display it in the Console ? Output Abundantcode.com coding sample Enter the First Number : 25 Enter the Second Number : 87 First Number is 87 Second Number is 25
Do-While Loop example in Java
The do-while loop in java is similar to the while loop except that the do-while loop is guaranteed to execute at least once . The do while loop evaluates its condition at the bottom of the loop. The syntax of the do-while loop in java can be written as do{statement(s)}while(expression) Do-While Loop example in Java Below is a sample code snippet demonstrating the usage of…