Tag: tutorials

C Program to display half-pyramid using alphabets

Problem Write a program in C to print half-pyramid using alphabets as shown below.The program should take the number of rows as input. A B B C C C D D D D How to create and display half-pyramid pattern in C using alphabets ? Output Abundantcode.com Coding samples Enter the limit : 4 A BB CCC DDDD

C Program to find GCD of two numbers

Problem Write a program in C to find the GCD of two numbers. How to find the GCD of two numbers in C ? GCD of two numbers refers to the largest integer value that can exactly divide both the number where the remainder is zero. Here’s a program in C demonstrating this. Output Abundantcode.com Coding Sample                                              Enter first Number: 24                                                Enter second Number: 18                                              …

Json.NET & Oxygene – How to Serialize a Collection?

Do you want to serialize an collection in your Remobjects Oxygene.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 Oxygene.NET using Json.NET library ? For example , assume…

Implicit Type Inference in C#

There are times when you want to declare a variable and assign a value to it even without having to figure out what the data type of the variable is . In C# , the var keyword provides the type inference feature where the compiler decides what type the local variable is . Below is a sample code snippet demonstrating the Implicit Type Inference in…

C Program to display full pyramid using *

Problem Write a program in C to print full pyramid using * as shown below.The program should take the number of rows as input.         *       * * *     * * * * *   * * * * * * * How to create and  display full pyramid pattern in C using * ? Output Abundantcode.com Coding samples Enter the limit: 4…

C Program to check if a Number is Positive or Negative

Problem Write a program in C to check whether a input number is a positive or negative number. How to check if a number is positive or negative in C ? Output Abundantcode.com coding samples                                                  Enter a number: 7                                                      The entered number is a positive number.

For loop in Java

The for loop in java lets the developers to iterate over a list of values . The for loop executes until the exit condition matches . Following the syntax of the for loop in java for (initialization; condition;increment){statement(s)} The initialization expression is used to initialize the loop and is executed as soon as the loop begins. The termination condition is verified every time and the…

While Loop example in Java

The while loop in java lets the developers execute a block of statements continuously until a particular condition is true . The syntax of the while loop in java can be written as while(expression){statement(s)} The while loop evaluates the expression which returns true and executes until the expression returns false. While Loop example in Java Below is a sample code snippet demonstrating the usage of…

JAR file operations in Java

Below are some of the common JAR File operations in Java. JAR file operations in Java jar cf This command creates a JAR file.Syntax : jar cf jar-file input-file jar tf This command is used to view the contents of the JAR file.Syntax : jar tf jar-file jar xf This command is used to extract the contents of a JAR file.Syntax : jar xf jar-file