Join Regular Classroom : Visit ClassroomTech

code window

Buffered Reader in java

Java BufferedReader class is used to read the text from a character-based input stream. It can be used to read data line by line by readLine() method. It makes the performance fast. It inherits Reader class. Java BufferedReader class declaration Let’s see the declaration for Java.io.BufferedReader class: public class BufferedReader extends Reader Output Latest Posts

Buffered Reader in java Read More »

Remove first two elements in Python List

There are many ways of doing it-1. pop method- list.pop()2. remove method- list.remove(list[index])3. del function- del list[index]4. slicing- list[2:] Here is an example for you- Output: Explanation:Here,pop(0) pops the first element from the list. The for loop executes the block 2 times which means the first element is popped every time the list gets updated.remove(b[0])

Remove first two elements in Python List Read More »

Remove the first element and add it to last in Python List

There are many ways of doing it, here are a few ways-1. pop method – list.pop()2. slicing – list[:1],list[1:] Here is an example for you- Output: Explanation:Here,pop(0) pops the first element from the list. Then the popped element is added to the last using append() method.d[:1] slices the array/list till index 0 which means the

Remove the first element and add it to last in Python List Read More »

Multidimensional array in java

In Java, multidimensional arrays are actually arrays of arrays. Data in multi-dimensional arrays are stored in tabular form. Example : Syntax: Data_type[1st dimension][2nd dimension]—-[Nth dimension] array_name=new data_type[size1][size2]—-[size N]; Where datatype Type of data to be stored in the array. For example int, char, etc. Dimension: The dimension of the array created. For example : 1D,

Multidimensional array in java Read More »

Reverse a String in C

What is String?The string is a character array that ends with a null character denoted by ‘\0’. Now, in this program, we have to reverse a string in c programming.Suppose the Input is: codewindowThen the Output will be: wodniwedoc We have definitely different approaches to code this program. Using in-built function strrev() Without using in-built

Reverse a String in C Read More »

Boolean in java

Java has a primitive datatype, called boolean, for logical values. It can have only one of two possible values,true or false. After any conditional operations, it returns true or false.Example: Output Literals in java Integer Literals: Integers are probably the most commonly used type. Any whole number value is an integer literal. Examples are 1,

Boolean in java Read More »

C++ Coding Question 3

Write a program that asks you to type a number. After each entry, the application reports the cumulative sum of entries. The program terminates when you enter a zero. C C #include<iostream>using namespace std; int takeinput(){int num;cout<<“nnPlease enter the next number or Press 0 to exit: “; while(!(cin>>num)){cin.clear();while(cin.get()!=’n’)continue; cout<<“Wrong Input..So Please enter a valid input”;cout

C++ Coding Question 3 Read More »