Chew Code | Guide to Computer Programming Basics

Get C++ Tutorials, Projects, Practicals, Practice Papers for CBSE Class 12 & 11.

Generics : C# and .NET Interview Question – Lesson for beginners

Generics is one of the most important concept of object oriented programming. It exists not only in C# but is also used extensively in popular programming languages including Java. While Generics is an important concept which is often neglected, it remains to be one of the favorite question in C# and .NET interviews. One of our known was once working with TCS and on his very first viva during his training program,...

What are Various Types of Constants in C++ and their Use

We had given an introduction to constants when we had talked about the different types of tokens in C++. Now let us study constants in detail and see how they are used in C++ programs. First let us recall what constants are. DEFINITION : They are data items that do not change during a program. They are also called literals. So both the terms constants and literals are used interchangeably. TYPES OF CONSTANTS/LITERALS...

How to Declare and Initialize Variables in C++ – Tutorial for Beginners

In the previous post, we had seen what are the various built-in data types in C++. We are now ready to use them to create variables in our programs. First let us see what variables actually are and how they work. Definition : Variables are symbolic names given to memory locations that store various values. In other words, when we declare a variable and assign it any value, that value gets stored in memory at...

Registrations opened for Google Code Jam 2015 event

Google Code Jam is a renowned international programming/coding competition hosted officially by Google; Google Code Jam 2015 is now back with a bang. Registrations are still opened for the Google Code Jam 2015 event (started from March 10 and will end on April 12) and the qualification round will end on April 10. As it is an international event therefore finals will take place in Seattle, Washington (USA). Google...

Built-In Data Types in C++: char, int, float, double

Data types in C++ are keywords that are used to specify the type of the data we use in our C++ programs. There are many data-types available in C++. They are classified under two categories: Built-In or Fundamental Data types Derived or User-Defined Data types Built-in data types Built-in data types are the most basic data-types in C++. The term built-in means that they are pre-defined in C++ and can be used...

Compilation, Linking & Execution of a C++ program: Tutorial for beginners

In the previous post, we had learned to write a basic  C++ program. We should now understand how a program works and how the computer handles it. Let us see the different phases a C++ program goes through before execution. PHASE 1: PREPROCESSING Preprocessor directive #include is used to include header files in our program. These header files contain declarations (name and type) of certain predefined elements...

Use of endl and setw manipulators in C++

In the previous post, we had shown how basic input/output is performed in C++. Along with input/output operators, C++ provides a facility to control how the output is displayed on the screen. This is done using manipulators. Let us understand what manipulators are.  Manipulators are functions that are used to format or modify the output stream in various ways. They have a special characteristic that they are...

How to Perform Basic Input/Output Operations in C++

Input and Output operations are an important part of any program. Input operations take data from the user and output operations display the result of the program to the user. Let us understand the basic input/output operations in C++ program with the help of a simple program. The following program takes two numbers as input from the user, multiplies them and displays the result to the user. <em>//Program...

Structure & Components of a basic C++ program – Tutorial for CBSE Class 11 & 12

Having learned about tokens in C++, we are now ready to write our first C++ program. The aim is to learn the basic structure and components of a C++ program. So what follows next is our program. It has been written and executed using the Dev C++ Compiler. <em>//I am going to write my first C++ program /* The aim is to learn : 1) Structure of a program 2) Basic Components of a program */ #include<iostream> #include<conio.h> using...

5 Types of Tokens in C++ : CBSE Class 11 & 12 Basics

In our previous post, we had talked about the character set used in C++. We will next discuss tokens in C++ and their various types. Let us now find out what a token is. DEFINITION: A token is the smallest identifiable and individual unit in any program. It is formed when a group of characters is combined together. There are five types of tokens in C++ language: Keywords Variables/Identifiers Constants/Literals Punctuators Operators 1....