You are here: Home / Topics / Page / 3

Unit-3: Control structures : BCA semester 1

Filed under: BCA Study Material on 2023-10-30 07:39:03
Control structures in C programming allow you to control the flow of execution of your program based on conditions or repetition. There are three main control structures in C:Conditional (if-else) statements: These are used to execute a block of code only if a certain condition is met.Example:int x 

Java program to sort an array in ascending order

Filed under: Java on 2023-10-29 09:53:28
In this java program, we are reading total number of elements (N) first, and then according the user input (value of N)/total number of elements, we are reading the elements. Then sorting elements of array in ascending order and then printing the elements which are sorted in ascending order.Programi

Java String compareTo() Example Code

Filed under: Java on 2023-10-26 21:45:31
class Main { public static void main(String[] args) {   String str1 = "Learn Java";   String str2 = "Learn Java";   String str3 = "Learn Kolin";   int result;   // comparing str1 with str2   result = str1.compareTo(str2);   S

Java String split() Example

Filed under: Java on 2023-10-26 21:42:57
class Main { public static void main(String[] args) {   String text = "Java is a fun programming language";   // split string from space   String[] result = text.split(" ");   System.out.print("result = ");   for (String str : result) {  &n