Arrays in C# programming

Array is a collection of variables of fixed size stored in a continuous memory location. They are also known as elements. These elements are accessed by its index. The elements in an array are numbered from 0 to n-1 (n being the length of array), those numbers are called indices.

Function Overloading in C++ Programming

If more than one functions having same name but differing in terms of number and types of argument it takes is used in a class, it is known as function overloading. It is an example of compile time polymorphism (static/early binding). The compiler determines which function is called during compile time based on the number and types of argument sent.

Friend function in C++ Programming

In C++, private members remain hidden and can only be accessed by other member function of that class and friend function. Friend function is defined or declared using keyword 'friend' before the function prototype inside the class. It takes objects as parameter and access their private members using object name and dot(.) operator. Friend function is used when we need to operate on data of two or more objects of same or different classes. For e.g.

C Program to Display Prime Numbers Between Two Numbers

A prime number is the number which can be exactly divided by only 1 and the number itself. For example, 5 can only be exactly divided by 1 and the number itself, so 5 is a prime number. But 8 can be divided by 1, 2, 4 and 8 so it is not a prime number but a composite number. To find and display all prime numbers between 10 and 100, nested loop is to be used. The outer loop runs from 10 to 100 and the inner loop checks whether the number is prime or not.

Pages