Arithmetic Operation With Pointer

In a C programming, we can also perform arithmetic operations with pointer. There are four arithmetic operators that can be performed with pointers: Increment (++) Decrement ( — ) Addition ( + ) Subtraction ( – )  For a simple variable int a=3;a++; //print 4Increment integer value by one. Pointer is a variable which can … Read more

Loops in C Programming

In a programming often a situation may comes where we want to  execute the set of code again and again. Loop has a ability to repeat set of statement until a condition to be satisfied or a particular number of times. There are following types of  loop in C language: In a C programming language … Read more

Ternary Operator in C Language

This operator also known as conditional operator . It is similar to if-else statement. Syntax of ? operator

There are three expressions in ? operator, Expression1, Expression2, and Expression3 . The value of a ? expression is determined like this − If Exp1 is true, then Exp2 is evaluated. If Exp1 is false, then … Read more

Difference between structure and union in C Programming

In C programming, both structures (structs) and unions are used to define custom data types that can hold multiple variables of different data types. However, they have distinct differences in terms of how they allocate memory and how they store data: 1. Memory Allocation: 2. Memory Usage: 3. Accessing Data: 4. Use Cases: Aspect Structure … Read more

History of C Programming

C is computer programming language developed in 1972 by Dennis M. Ritchie. C programming language developed in  Bell Laboratories to develop the UNIX operating system. C is a  high-level language which can be easily read and written by any one. C is a case-sensitive programming language. Thus, “HELLO” and “Hello” two different identifiers in C.

Primitive Data Types in C Programming

1. What is data type in C Data type specifies what type of data a variable can hold. There are four category of data type in C language.  They are as follows: Types Data Types Basic (Primitive) data types int, char, float, double Enumeration data type Enum Derived data type pointer, array, structure, union Void … Read more

For Loop in C programming with examples

For loop in C programming is a statement to repeat the set of statements until a condition to be satisfied. Syntax of for loop statement: for(initialization; conditionCheck; updation ) { statement 1; statement 2; ————– } “for-statement” has a initialization , condition and iteration (increment/ decrement) part separated by semicolon. Initialization : This phase allows … Read more

Do While Statement in C Programming

like a while statement,  “ do while statement” repeats a set of statements if condition is true. If condition is false the flow of control do not enter inside the do-while loop. “do-while” first execute the body of loop than tests the condition. Means even if the condition if false do-while executes at least ones. … Read more

While Statement in C Programming

“while loop” repeats a set of statements if condition is true. If condition is false the flow of control do not enter inside of while loop. It first tests the condition then execute the body of loop. Syntax of a while statement−

Example: Write a program to print 1 to 10 using while loop.

Read more