Found 33676 Articles for Programming

How to start object-oriented programming in C++?

Arjun Thakur
Updated on 02-Mar-2020 08:09:42

875 Views

Object-oriented programming (OOP) is a programming paradigm based on the concept of "objects", which may contain data, in the form of attributes; and instructions to do things, in the form of methods.For example, a person is an object which has certain properties such as height, gender, age, etc. It also has certain methods such as move, talk, and so on.ObjectThis is the basic unit of object oriented programming. That is both data and function that operate on data are bundled as a unit called as object.ClassWhen you define a class, you define a blueprint for an object. This doesn't actually ... Read More

What is the use of the '&' symbol in C++?

Sravani S
Updated on 07-Nov-2023 20:29:43

31K+ Views

The & symbol is used as an operator in C++. It is used in 2 different places, one as a bitwise and operator and one as a pointer address of operator.Bitwise ANDThe bitwise AND operator (&) compares each bit of the first operand to that bit of the second operand. If both bits are 1, the bit is set to 1. Otherwise, the bit is set to 0. Both operands to the bitwise AND operator must be of integral types. Example #include   using namespace std;   int main() {      unsigned short a = 0x5555;      // pattern 0101 ...      unsigned short b = 0xAAAA;      // pattern 1010 ...      cout

What are undefined reference/unresolved external symbol errors in C++?

Daniol Thomas
Updated on 23-Jun-2020 13:26:30

1K+ Views

As the name suggests, a symbol you declared was not defined by you. This may occur due to many cases. Let's have a look at three of them −You forgot to define the declared name. For example, you declared a function in a file and used it somewhere. But you did not provide its definition. Code −#include void foo(); int main() {    foo(); // Declared but not defined }You defined it but did not use the qualified name. Say you created a class with a method and defined that method but forgot using scope resolution to link that function ... Read More

C++11 Features Supported by Intel

Priya Pallavi
Updated on 30-Jul-2019 22:30:21

175 Views

The C++11 features supported by Intel are available as an official guide in their docs. You can check these features out on https://software.intel.com/en-us/articles/c0x-features-supported-by-intel-c-compiler.

How to stop form submission using JavaScript?

Abhishek
Updated on 06-Sep-2023 13:02:30

61K+ Views

In this tutorial, we will see the methods to stop form submission using JavaScript. Generally, the HTML form by default submitted automatically if we try to perform some operations by using some events. The automatic submission of the form leads the browser to refresh and reload the whole page again, which we don’t want to perform in some cases. So, to perform any operation before submission we need to change the default behavior of the form to prevent it from submission. Following are the methods we can use to stop form submission − Using the "return false" value Using ... Read More

How to Check Leap Year using Python?

Akshitha Mote
Updated on 12-Dec-2024 19:45:16

952 Views

A year that occurs every four years is considered a leap year in the calendar. For example, 2024 is divisible by 4 therefore, it is a leap year. Conditions for a Leap Year To determine whether a given year is a leap year, the following conditions must be met − The year must be divisible by 4. If the year is divisible by 100, it must also be divisible by 400 to qualify as a leap year. If the year is divisible by 100 but not ... Read More

How to style background image to no repeat with JavaScript DOM?

Abhishek
Updated on 25-Nov-2022 06:45:05

3K+ Views

In this tutorial, we will learn to style the background image to no repeat with JavaScript DOM. To style the background image to no repeat with JavaScript, use the backgroundRepeat property. It allows you to set whether the background image repeats or not on a page. The use of images in the background really makes the page attractive. But before using the image in the background, one must need completely understand the properties used to set the images as the background. Otherwise, it will create problems for you like not showing the full image in the background, repeating the image ... Read More

How to zip a Python Dictionary and List together?

Vikram Chiluka
Updated on 09-Nov-2022 07:04:11

12K+ Views

In this article, we will show you how to zip a python dictionary and list together. Below are the various methods to accomplish this task − Using zip() function Using append() function and items() function Using append() function and in operator. Combing dictionary and list together using zip() Algorithm (Steps) Following are the Algorithm/steps to be followed to perform the desired task − Create a variable to store the input dictionary. Create another variable to store the input list. Use the zip() function(The zip() function can be used to combine two lists/iterators) to combine the input ... Read More

How to create Python dictionary with duplicate keys?

SaiKrishna Tavva
Updated on 17-Oct-2024 12:16:03

6K+ Views

In Python, a dictionary doesn't allow duplicate keys or repeated keys. So, we can use defaultdict from the Collections module. As it can store multiple values for the same key in the form of lists or any other data structures. 'defaultdict' from 'collections' Module The subclass of the built-in dict class that allows us to provide a default value for a key that doesn't exist is known as defaultdict. A function that returns the default value for new keys is known as 'default factory', and if you want to pass this default factory, we can use a list which allows storing ... Read More

How to Find Armstrong Number in an Interval using Python?

Jayashree
Updated on 21-Feb-2020 12:58:37

818 Views

If sum of cubes of individual digits in a number add up to the number itself, it is called armstrong number. for example 153=1**3+5**3+3**3ExampleFollowing Python program find armstrong numbers between 100 to 1000for num in range(100,1000):   temp=num   sum=0   while temp>0:       digit=temp%10       sum=sum+digit**3       temp=temp//10       if sum==num:            print (num)OutputThe output is as follows −153 370 371 407

Advertisements