Category: C Programming


C and C++ Cheat Sheet

C and C++ Cheat Sheet In this C and C++ cheat sheet we’ll cover all the syntax of C and C++ programming within one page. Libraries #include<stdio.h> for input and output functions #include<string.h> for string related functions #include<stdlib.h> for memory Read more…


Looping is a powerful programming technique through which a group of statements isexecuted repeatedly, until certain specified condition is satisfied. Looping is alsocalled a repetition or iterative control mechanism.C provides three types of loop control structures. They are:for statementwhile statementdo-while Read more…


The switch-case statement is used when an expression‘s value is to be checked againstseveral values. If a match takes place, the appropriate action is taken. The generalform of switch case statement is:switch (expression){case constant1 :statement;break;case constant2 :statement;break;default:statement;break;}In this construct, the Read more…


Conditional Statements: Sometimes we want a program to select an action from two or more alternatives. Thisrequires a deviation from the basic sequential order of statement execution. Suchprograms must contain two or more statements that might be executed, but have Read more…


To tell the user that you need to do something, you need to put something on theconsole window, usually text, but sometimes combined with the results of otherworkings of your program. There are a few functions that help us to Read more…


It is necessary to be careful of the meaning of such expressions as a + b * c.We may want the effect as either(a + b) * cora + (b * c)All operators have a priority, and high priority operators Read more…


Operators: There are three general classes of operators: arithmetic, relational and logical andbitwise. Arithmetic Operators:   As well as the standard arithmetic operators ( + – * /) found in most languages, Cprovides some more operators.Assignment is = i.e. i Read more…


A variable is a temporary storage place for keeping an item of information. Thismay then be used or altered later in a program following some calculations.Each variable holds a specific type of information – for example a whole number, adecimal Read more…


ANSI C allows you to declare constants. When you declare a constant it is a bit like avariable declaration except the value cannot be changed.Syntax for initializing a const data type:Const data-type variable = initial value;Example:const int a = 1;const Read more…


When creating your programs, here are a few guidelines for getting a program that canbe easily read and debugged by you (when you come back to it later) and others (whomay have to change your program later). A well-structured program Read more…

Custom Search