Tag: tutorials
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 : 1 Enter second number : 2 1 + 2 = 3
Keywords in Java
Below are some of the well known keywords in Java Keywords in Java abstractassertbooleanbreakbytecasecatchcharclassconstcontinuedefaultdodoubleelseenumextendsfinalfinallyfloatforgotoifimplementsimportinstanceofintinterfacelongnativenewpackageprivateprotectedpublicreturnshortstaticstrictfpsuperswitchsynchronizedthisthrowthrowstransienttryvoidvolatilewhile
Property Elements Example in Xaml for Simple Properties
In Xaml , you can use the property element for simple properties as well . For example , you can set the Height and width of the Button control in Xaml using the property element syntax instead of attributes. Below is the sample code snippet demonstrating this. Property Elements Example in Xaml for Simple Properties
C# Program to display "Hello, World!"
Problem Statement Write a program in Visual C# to print Hello World in the console Window. How to display Hello World in C# ? Output Hello, World!
Java – How to Check if a string is a valid number?
Problem statement You need to check if a input string contain a valid number or not. Solution Use the appropriate wrapper class for converting the string to numeric formats. For example Double to convert string to double as shown below. When the input is a invalid number , the NumberFormatException is caused which needs to be handled by the developers.
Example of If Conditional Statement in F#
Example of If Conditional Statement in F#
C Program to display half-pyramid using numbers
Problem Write a program in C to print half-pyramid using numbers as shown.The program should take the number of rows as input. 1 1 2 1 2 3 1 2 3 4 How to create and display half-pyramid pattern in C using numbers? Output Abundantcode.com Coding samples Enter the No. of rows:4 1 1 2 1 2 3 1 2 3 4
Java – How to create a random number which is less than 25 ?
Problem Statement You need to create a random number which is less than 25 in Java. Solution Use the Random class’s nextInt method and pass the value within which the random number needs to be generated.
How to sort an array using Comparator in Java ?
The Arrays.sort method in java lets the developers to sort an array of objects. The sort method also accepts the comparator object which can contain the sorting logic. How to sort an array using Comparator in Java ? Below is a sample code snippet demonstrating the usage of the Arrays.sort method with the comparator.
SelectMany Example in LINQ and C#
Below is a sample source code demonstrating the usage of the SelectMany method in LINQ and C#. One of the usage of the SelectMany is to return the flat list an avoid returning the lists of lists. SelectMany Example in LINQ and C#
Java – How to Convert Long to String in Java ?
Problem Statement You need to convert long to a string value in your java program. Solution Use the toString method to convert long to string in Java. The output for the above program is Abundantcode.com Java Tutorials 75
C Program to find the ASCII Value of a Character
Problem Write a program in C to find the Ascii value of a character entered by the user and display the result on the screen. How to find the ASCII Value of a Character in C ? When the user enters the character A , the value 65 (Ascii value) should be displayed on the screen. Here’s a C program for it. Output Enter a…