Pointer to Array in C

The array is also called a constant pointer. This pointer points to the first element of the array. Whenever you create an array, this pointer is automatically created. So, if you assign an array name to a pointer variable, then there is no need to use an address of the (&) operator before the name … Read more

Java program to convert Fahrenheit scale to Celsius

This Java program source code converts temperature from Fahrenheit to Celsius scale. import java.util.*; class FahrenheitCelsius { public static void main(String[] args) { float temp; Scanner inn = new Scanner(System.in); System.out.print(“Enter temperature in Fahrenheit=”); temp= inn.nextInt(); temp = ((temp – 32)*5)/9; System.out.println(“Temperature in Celsius = ” + temp); } } In the above program, you … Read more

Java Program To Swap Two Numbers

Write a program in Java to Swap two digits using a third variable. import java.util.Scanner; class Swapping { public static void main(String args[]) { int first_no, sec_no, third_no; System.out.println(“Enter first_no and sec_no”); Scanner in = new Scanner(System.in); first_no = in.nextInt(); sec_no = in.nextInt(); System.out.println(“Before Swapping\nfirst_no = “+first_no+”\nsec_no = “+sec_no); third_no = first_no; first_no = sec_no; … Read more

How To Take Input From User In Java

In this tutorial, I am going to show you how to take input from users in Java using two different ways. You can follow any method(Scanner, Buffered) according to your convenience. To understand how we get input from users in Java we first must know the following two things : System.out – Java uses System.out to … Read more

Visibility modes in C++

In C++, visibility modes refer to the accessibility of class members (such as variables and functions) from different parts of a program. C++ provides three visibility modes: public, private, and protected. These modes control the access levels of class members concerning the outside world and derived classes. Public: Members declared as public are accessible from … Read more

Inheritance in C++

In C++, inheritance is a fundamental concept of object-oriented programming (OOP) that allows you to create a new class based on an existing class, known as the base or parent class. The new class is called the derived or child class. Inheritance facilitates code reuse and supports the creation of a hierarchy of classes. There … Read more

C++ Classes and Objects

In C++, classes and objects are fundamental concepts that support object-oriented programming (OOP). Here’s a brief overview of classes and objects in C++: Classes: In C++, a class is a user-defined data type that allows you to encapsulate data members and member functions into a single unit. Classes are the building blocks of object-oriented programming … Read more

HTML Marquee tag

The <marquee> tag is an HTML element that was used in earlier versions of HTML to create a scrolling or moving text or image within a web page. It was primarily employed to add dynamic and attention-grabbing effects to text or images. The content within the <marquee> tag would continuously move across the screen in … Read more

this pointer in C++

In C++, the “this” pointer is a keyword that represents a pointer to the instance of the class to which the member function belongs. It is implicitly passed as a hidden argument to all member function calls. Here’s a basic explanation of the “this” pointer: Types of this pointer Pointer to the Current Object: Inside … Read more