Shell is an interface using which the programmer can execute command and interact directly to the operating system. Shell scripting is giving commands that a shell can execute.In shell also there are variables and operators that are used to manipulate these variables. There are 5 basic operators in shell scripting.Arithmetic OperatorsRelational OperatorsBoolean OperatorsBitwise OperatorsFile Test OperatorsArithmetic OperatorsArithmetic operators in shell scripting are used to perform general arithmetic/ mathematical operations. There are 7 valid arithmetic operators in shell scripting −Addition (+) is used to add two operands (variables).Subtraction (-) is used to subtract two variables (operands) in shell scripting.Multiplication (*) is ... Read More
Relational Algebra is a procedural query language, it is used to provide a single table / relation as output of performing operations on more than one relations. Some of the basic relations will be discussed here.In our course of learning, we will use three relations (table) −Table 1: courseCourse_idName1Computer science2Information Technology3mechanicalTable 2: studentsRoll No.Nameaddressage1RamDelhi182Rajuhyderabad204FaizDelhi225Salmanhyderabad20Table 3: HostelSt. No.Nameaddressage1RamDelhi182Akashhyderabad203nehaJhansi21On this relations, we will perform some operation to make new relation based on operations performed.Selection operation (σ) − The selection operator denoted by sigma σ is used to select the tuples of a relation based on some condition. Only those tuples that fall ... Read More
C++ programming language is a versatile programming language. Using C++ you can create low end graphics too i.e. creating basic shapes and words with stylish fonts and adding colors to them can be done using c++.Graphic programming can be done in c++ using your terminal or command prompt or you can download DevC++ compiler to create graphic programs.For terminal you need to add the graphics.h libraray to you GCC compiler. For this you will have type in the following commands.>sudo apt-get install build-essential >sudo apt-get install libsdl-image1.2 libsdl-image1.2-dev guile-2.0 \ guile-2.0-dev libsdl1.2debian libart-2.0-dev libaudiofile-dev \ libesd0-dev libdirectfb-dev libdirectfb-extra libfreetype6-dev \ ... Read More
In this tutorial, we will be discussing a program to find the radius of the incircle of a given triangle.For this, we will be provided with the sides of a particular triangle and our task is to find the radius of the incircle in that triangle.The formula for finding the radius of incircle isarea of the triangle/half perimeter of the triangleExample#include using namespace std; //calculating the radius of incircle float calc_radius(float a, float b, float c) { if (a < 0 || b < 0 || c < 0) return -1; //half perimeter of ... Read More
In this tutorial, we will be discussing a program to find the quantity of milk left after mixture replacement.Let us suppose we have X litres of milk. From that, Y litres of milk is replaced with Y litres of water itself. This same procedure is done again and again Z number of times. Our task is to find the final amount of milk left in the container.Finding the relation among the values between the repetitive operations, we find the formula for finding the amount of milk after Z number of operations to beamount left = ((X-Y)/X)Z*XExample#include using namespace std; ... Read More
We are given with an integer ‘n’ and the task is to generate the hexagonal pattern and display the final output.ExampleInput-: n=5 Output-:Input-: n = 4 Output-:Approach we are using in the given program is as follows −Input the number ‘n’ from userDivide the entire pattern into three parts i.e. upper part, middle part and lower part Start loop i for printing the upper part of the pattern from i to 0 and i to be less than n and keep incrementing the value of i Start loop m for printing the middle part of the pattern from m to ... Read More
Microsoft Office is a tool that most computer users across the globe use as a part of their daily lives with professionally or personally. The tool is so intertwined in the activities that we use at all levels of requirements – just from simply typing in a word document to using excel sheets at a complex level.When it comes to a professional level of learning, students and professionals look at acquiring deeper knowledge in software and technologies but tend to not realize the importance of MS Suite that is indispensable at every aspect of work. With decade-plus years of experience ... Read More
This class matches the upper case alphabetic characters.Example 1import java.util.Scanner; import java.util.regex.Matcher; import java.util.regex.Pattern; public class Posix_LowerExample { public static void main( String args[] ) { //Regular expression to match upper case letters String regex = "^\p{Upper}+$"; //Getting the input data Scanner sc = new Scanner(System.in); System.out.println("Enter 5 input strings: "); String input[] = new String[5]; for (int i=0; i
This class matches the lower case alphabetic characters i.e. a to z.Example 1import java.util.Scanner; import java.util.regex.Matcher; import java.util.regex.Pattern; public class Posix_LowerExample { public static void main( String args[] ) { //Regular expression to match lower case letters String regex = "^\p{Lower}+$"; //Getting the input data Scanner sc = new Scanner(System.in); System.out.println("Enter 5 input strings: "); String input[] = new String[5]; for (int i=0; i
The Posix character class \p{ASCII} matches the ASCII characters and the meta character ^ acts as negation.i.e. The following expression matches all the non-ASCII characters."[^\p{ASCII}]"The replaceAll() method of the String class accepts a regular expression and a replacement-string and, replaces the characters of the current string (matching the given pattern) with the specified replacement-string.Therefore, You can remove the matched characters by replacing them with the empty string “, using the replaceAll() method.Example 1import java.util.Scanner; public class Exp { public static void main( String args[] ) { Scanner sc = new Scanner(System.in); String regex = ... Read More
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP