Escape Sequences in C

This C Tutorial explains Escape Sequences/Character Escapes and why they are needed. What is an Escape Sequences in C? One or more characters following ‘\’ (the backslash) is considered to be a single character and is called the escape sequence. List of Escape Sequences in C: \? used to write multiple question marks from being … Read more


Difference between Macros and Constants in C

This C Tutorial explains the difference between Macro and Const Declaration. Lets start with: what is/are the difference/s between the following two statements and which of these two is efficient and meaningful? #define SIZE 50 int const size = 50; Answer: MACROS 1. The statement “#define SIZE 50” is a preprocessor directive with SIZE defined … Read more


Difference between For and While Loop in C

This C Tutorial explains the differences between the while and for loop in C. While Loop In while loop, condition is checked before execution of each iteration and as condition fails, loop terminates. While Loop Syntax   /* * In while, condition is tested in the beginning of each iteration */   while (condition) { … Read more


Loops in C (For, While and Do-While Loop Statements)

This Tutorial explains various loops in C with example usage. A loop statement is one that repeatedly executes, ensuring a given condition to be true prior to execution of each iteration, to perform some computations/work. As the condition turns false, loop terminates. There are three types of loops in C programming language. While Loop For … Read more


Difference between While and Do-while Loop in C

This C Tutorial explains the difference between While and Do-while Loop in C Programming. Do-while Loop in C In do-while loop, condition is always tested after the execution of the iteration and if condition fails, loop terminates. Therefore, do-while loop executes at least one iteration before termination if condition fails in first iteration! Do-while loop … Read more


Conditional Statements in C Programming

This C Tutorial explains various conditional statements in C Language with example usage. What is Conditional Statement? Conditional statements in C are used to make decisions based on whether a condition is true or false. Conditional statements cause variable flow of execution of the same program, each time the program is run, based on certain … Read more


Goto Statement in C

What is a goto statement in C Programming Language? The goto statement is a jump statement that transfers the program control to a label. The target of the jump is specified by a label, which must be declared beforehand. The label can be any valid identifier declared in the same function in which the goto … Read more


Linkage, Scope of Variables and Functions in C

This C Tutorial explains Linkage/Scope of variables and functions in C with examples and defines the type of Linkages. Linkage of any variable and/or function defines the Area of the Program in which they are accessible. There are three types of Linkages for the variables & functions. These are as follows 1. EXTERNAL 2. INTERNAL … Read more


Difference between Declaration and Definition of a Variable in C

Question: What is the difference between declaration and definition of a variable? Answer: Declaration specifies the properties of a variable. For example: int x; /* x is an integer */ int roll_no[]; /* roll_no is an array of integers */ Definition declares a variable and causes the storage to be allocated. For example: int x … Read more


What is Dangling else in C?

This C Tutorial explains “Dangling else” in C. It explains the association of single else statement in a nested if statement. In nested if statements, when a single “else clause” occurs, the situation happens to be dangling else! For example: if (condition) if (condition) if (condition) else printf("dangling else!\n"); /* dangling else, as to which … Read more

Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.