Tag: tutorials

C Program to display inverted full pyramid using *

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

C Program to find if a character is a Vowel or Consonant

Problem Write a program in C to check whether a given character is a vowel or consonant. How to check if a character is a vowel or consonant in C Language ? In English , the alphabets A, E, I, O and U are vowels and the rest of the characters are consonants. Here’s a program that takes an input character from the user and…

C Program to Multiply two Floating Point Numbers

Problem Write a program in C to multiply two floating point numbers and then display the output on the console window. C Program to Multiply two Floating Point Numbers Output Enter two numbers: 6 7                                                                                                                                                        Product = 42.00

ElasticSearch – How to Interact with ElasticSearch using JSON over HTTP ?

Problem Statement You need to communicate with ElasticSearch to perform the search or the CRUD operations. Solution You can interact with ElasticSearch using the RESTful API over port 9200. Additionally , ElasticSearch has the official clients for various programming languages like .NET , Java , Ruby etc. The format of the request of ElasticSearch is as specified below. <VERB> <PROTOCOL> ://<HOST>/<PATH>?<QUERYSTRING> Additionally , it can…

F# Program to display "Hello, World!"

Problem Write a program in F# to display “Hello, World!” on the screen. F# Program to display “Hello, World!” in Console Window. This is a simple F# program that displays “Hello, World!” on the console window. Output Hello, World!

How to add Items to ListBox control in Xaml ?

You can add the Items to a List Box control in Xaml using the Items property . The Items property is an ItemCollection which implements IList. How to add Items to ListBox control in Xaml ? Below is a sample code snippet demonstrating the adding of the Items to ListBox in Xaml of a Windows 10 UWP App. The above showed how to add items…

Java – How to Convert Numbers to Objects and vice versa ?

Problem Statement You need convert numbers to objects and vice versa in your Java program. Solution There are times when you need to pass an object for a function where you have a numeric values. To convert numbers to objects and vice versa , you can use the corresponsing wrapper classes. For example , if you want to convert an int to Integer object or…

C Program to display Inverted half-pyramid using numbers

Problem Write a program in C to print Inverted half-pyramid using numbers as shown below.The program should take the number of rows as input. 1 2 3 4 1 2 3 1 2 1 How to create and display Inverted half-pyramid pattern in C using numbers ? Output Abundantcode.com Coding samples Enter number of rows: 4 1 2 3 4 1 2 3          1 2           …

C++ Program to add two integers

Problem Write a program in C++ to add two integers and display the result on the screen. C++ Program to add two integers Output Enter first number : 8                                                                                                                                                            Enter second number : 2                                                                                                                                                                  8 + 2 = 10

Java – How to round floating point number to integer ?

Problem Statement You need to round the floating-point numbers to integers in Java. Solution When you cast a floating value to integer in Java , the value gets truncated. For example , the value 7.8989 when casted to integer will become 7. In order to round he floating-point numbers correctly , you can use the Math.round() method. The Math.round method has a 2 overloaded forms….

How to mark a class as Obsolete or Deprecated in C# ?

Sometimes , you may want to mark a class or method as deprecated so that the you dont want to use the class any more and also want to let know , other developers that the class is obsolete . You can do that by using the Obsolete attribute as shown below . The Obsolete attribute also includes 2nd parameter (boolean) . When this valus…