Posts

Format specifier in c

  Format Specifier Type %c Character %d Signed integer %e or %E Scientific notation of floats %f Float values %g or %G Similar as %e or %E %hi Signed integer (short) %hu Unsigned Integer (short) %i Unsigned integer %l or %ld or %li Long %lf Double %Lf Long double %lu Unsigned int or unsigned long %lli or %lld Long long %llu Unsigned long long %o Octal representation %p Pointer %s String %u Unsigned int %x or %X Hexadecimal representation %n Prints nothing %% Prints % character

Variable in C/C++

A variable is an identifier which is used to store some value. Constants can never change at the time of execution. Variables can change during the execution of a program and update the value stored inside it. A single variable can be used at multiple locations in a program. A variable name must be meaningful. It should represent the purpose of the variable.

C Tokens in c language

 Smallest individual unit in a c language is called C Tokens.                                    Or Tokens are the smallest elements of a program, which are meaningful to the compiler. The following are the types of tokens: Keywords, Identifiers, Constant, Strings, Operators, etc.

Keyword in c language

K eywords Keywords are predefined, reserved words in C language and each of which is associated with specific features. These words help us to use the functionality of C language. They have special meaning to the compilers. There are total 32 keywords in C. auto double int struct break else long switch case enum register typedef char extern return union continue for signed void do if static while default goto sizeof volatile const float short unsigned

While loop in C/C++

While loop is also known as a pre-tested loop. In general, a while loop allows a part of the code to be executed multiple times depending upon a given boolean condition. It can be viewed as a repeating if statement. The while loop is mostly used in the case where the number of iterations is not known in advance. Syntax of while loop in C language The syntax of while loop in c language is given below: while(condition){   //code to be executed   }  

For loop in c /c++

for loop: for loop provides a concise way of writing the loop structure. Unlike a while loop, a for statement consumes the initialization, condition and increment/decrement in one line thereby providing a shorter, easy to debug structure of looping. Syntax: for (initialization condition; testing condition;                                increment/decrement) {     statement(s) }  

Flowchart to perform Arithmetic operation using switch statment in c

Image