# Tag Archives: school-programming

## Program for multiplication of array elements

We are given an array and we have to calculate the product of an array using both iterative and recursive method. Examples : Input :… Read More »

## Writing first C++ program : Hello World example

Learning  C++ programming can be simplified into: Writing your program in a text-editor and saving it with correct extension(.CPP, .C, .CP) Compiling your program using a… Read More »

## Setting up C++ Development Environment

C++ is a general-purpose programming language and widely used nowadays for competitive programming. It has imperative, object-oriented and generic programming features. C++ runs on lots… Read More »

## Program for average of an array (Iterative and Recursive)

Given an array, the task is to find average of that array. Average is the sum of array elements divided by the number of elements.… Read More »

## Conditionally assign a value without using conditional and arithmetic operators

Given 4 integers a, b, y, and x, where x can only either 0 and 1 only. The ask is as follows: If ‘x’ is… Read More »

## Number System and Base Conversions

Electronic and Digital systems may use a variety of different number systems, (e.g. Decimal, Hexadecimal, Octal, Binary). A number N in base or radix b… Read More »

## Loops in C and C++

Loops in programming come into use when we need to repeatedly execute a block of statements. For example: Suppose we want to print “Hello World”… Read More »

## Linear Search

Problem: Given an array arr[] of n elements, write a function to search a given element x in arr[]. Examples : Input : arr[] =… Read More »

## Introduction of DBMS (Database Management System) | Set 1

Important Terminology Database: Database is a collection of inter-related data which helps in efficient retrieval, insertion and deletion of data from database and organizes the data… Read More »

## endl vs \n in C++

Although they both seem to do the same thing, there is a subtle difference between them. cout << endl : Inserts a new line and… Read More »

## Functions in C/C++

A function is a set of statements that take inputs, do some specific computation and produces output. The idea is to put some commonly or… Read More »

## How arrays are passed to functions in C/C++

In C, when we pass an array to a function say fun(), it is always treated as a pointer by fun(). Below example demonstrates the… Read More »

## Structures in C

What is a structure? A structure is a user defined data type in C/C++. A structure creates a data type that can be used to… Read More »

## Compiler vs Interpreter

Compiler and Interpreter are two different ways to execute a program written in a programming or scripting language. A compiler takes entire program and converts… Read More »

## C/C++ Program to find sum of elements in a given array

Given an array of integers, find sum of its elements. Examples : Input : arr[] = {1, 2, 3} Output : 6 1 + 2… Read More »