Program to perform functions of a calculator

The Switch-case statement is a multi way decision statement. If and if-else are used for small number of choices but when we have large number of conditions we use switch-case statement. Depending upon the value supplied by user, the appropriate case is matched, the corresponding statements will be executed, all the other cases will be skipped.

Program to illustrate the concept of passing pointers as arguments

In function when we pass arguments by value then the photocopy is actual arguments is passed to formal arguments where as in call by reference the actual address of actual arguments passed to formal arguments.

Bitwise operator

Bitwise operator are used for manipulating of data at bit(0,1) level.These operator are used for testing the bits and shifting from right to left.The bitwise operators are AND, OR, XOR, SHIFT RIGHT, SHIFT LEFT, EXCLUSIVE OR(^).

Program to check the given number is Armstrong or not

Armstrong number is that number which are of three integer digits, which sum of the cube of its individual digits is equal to that number which we enter like 153 ,the cube of 1 and the cube of 5, and the cube of 3 and the sum of both (1*1*1)+(5*5*5)+(3*3*3)=153 means its armstrong number.

others are.....370,371,407 etc

Constructor with sqrt function in C++

Most of the mathematical functions are placed in `math.h` header file. sqrt returns the positive square root of floating point .Mathmetical functions like abs, sin, cos, sqrt etc.

Program to copy array in Java

The technique used to copy one array into another is same as used to copy 4 separate variable. In an array we use same type elements and fixed size collection means finite number of objects.Array elements are counted beginning with 0(zero).

Creating thread to print out messages

Multithreading means we can divide the program into two or more subprograms. All the subprograms can be implemented at the same time in parallel.We use run() for executing the sequence of code  that the thread will execute.

Program to count the characters in the string

String is a series of characters and it can be delimited using double quotes(“”). By using character array we can represent a sequence of characters in C++. Character arrays has being able to query their length, they themselves are not good enough to support the range of operations we may like to perform on string.

Program in Java that prints the half lower of the Array

Array having more than one dimensional are called multi dimensional([multiple rows][ multiple col]) arrays. An array having two dimensional is called two-dimensional([2rows][2col]) array.

StringBuffer in Java

The StringBuffer class is mostly used when we have to make a lot of modifications(any changes) to Strings of characters. String class does not support string mutability. That is why we use StringBuffer class.Objects of StringBuffer class can be modified a number of times.

Page 24 of 30