C Programming Language Last Updated : 16 Jan, 2023 C is a procedural programming language. It was initially developed by Dennis Ritchie as a system programming language to write an operating system. The main features of C language include low-level access to memory, simple set of keywords, and a clean style, these features make C language suitable for system programming like operating system or compiler development. Recent Articles on C ! C Programming Examples C Output & Multiple Choice Questions Basics, Variable Declaration, Definition and Scope, Data Types, Storage Classes, Input/Output, Operators, Preprocessor, Array & Strings, Control Statements, Functions, Pointers, Enum, Struct and Union, Memory Management, File Handling, Puzzles, Misc, C Language Interview Questions, Multiple Choice Questions Basics: C Language Introduction C Programming Language Standard int (1 sign bit + 31 data bits) keyword in C Is it fine to write “void main()” or “main()” in C/C++? Difference between “int main()” and “int main(void)” in C/C++? Macros and Preprocessors in C Compiling a C program:- Behind the Scenes Benefits of C over other languages Program error signals Escape sequences in C Line Slicing in C C/ C++ Tokens Variable Declaration, Definition and Scope: Variables and Keywords in C How are variables scoped in C – Static or Dynamic? Scope rules in C How Linkers Resolve Multiply Defined Global Symbols? Quiz on Variable Declaration and Scope Complicated declarations in C Redeclaration of global variable in C Internal and External Linkage Declare variable as constant Why variables doesn’t start with numbers Redeclaration of global variables Initialization of global and static variables Data Types: Data Types in C Use of bool in C Integer Promotions in C Quiz on Data Types in C Comparison of a float with a value in C Need of long data type in C size_t data type in C Interesting facts about data-types and modifiers Float and Double in C Character arithmetic in C Typecasting in C Storage Classes: Storage Classes in C Static Variables in C Understanding “extern” keyword in C What are the default values of static variables in C? Understanding “volatile” qualifier in C Const Qualifier in C Initialization of static variables in C Understanding “register” keyword in C Quiz on Storage Classes in C Understanding volatile qualifier in C- Set 1 Input/Output: Returned values of printf() and scanf() What is return type of getchar(), fgetc() and getc() ? Scansets in C puts() vs printf() for printing a string What is use of %n in printf() ? How to print % using printf()? Quiz on Input Output in C Difference between printf, sprintf and fprintf? Difference between getc(), getchar(), getch() and getche() Difference between %d and %i format specifier Use of fflush(stdin) in C Clearing input buffer in C/C++ scanf() and fscanf() in C getchar_unlocked() in C Problem with scanf() Differentiate printable and control character rand() and srand() in C/C++ Operators: Introduction to operators in C and Arithmetic Operators Relational and Logical Operators in C Bitwise Operators in C Operator Precedence and Associativity in C Evaluation order of operands Comma in C and C++ sizeof operator in C Operands for sizeof operator A comma operator question Result of comma operator as l-value in C and C++ Order of operands for logical operators Increment (Decrement) operators require L-value Expression Precedence of postfix ++ and prefix ++ in C/C++ Modulus on Negative Numbers C/C++ Ternary Operator – Some Interesting Observations Pre-increment (or pre-decrement) in C++ Difference between ++*p, *p++ and *++p Results of comparison operations in C and C++ To find sum of two numbers without using any operator Sequence Points in C Execution of printf with ++ operators Anything written in sizeof() is never executed Difference between strlen() and sizeof() Stringizing and Token-pasting operator Preprocessor: Write a C macro PRINT(x) which prints x Variable length arguments for Macros Multiline macros in C CRASH() macro – interpretation The OFFSETOF() macro, Branch prediction macros in GCC Diffference between #define and const in C? A C Programming Language Puzzle What’s difference between header files “stdio.h” and “stdlib.h” ? How to print a variable name in C? Constants in C How a Preprocessor works Preprocessor Directives : Behind the scene-1 Preprocessor Directives : Behind the scene-2 isgraph() library function write your own header file in C difftime() library function tmpnam() library function _Generic keyword in C math.h library functions typedef versus #define in C strftime() library function exec family of functions Arrays & Strings: Introduction to Arrays in C Language Strings in C Language Properties of array in C Language Do not use sizeof for array parameters Initialization of variables sized arrays in C Are array members deeply copied? What is the difference between single quoted and double quoted declaration of char array? Initialization of a multidimensional arrays in C/C++ Write one line functions for strcat() and strcmp() What’s difference between char s[] and char *s in C gets() is risky to use! C function to Swap strings, Storage for Strings in C Difference between array and pointer How to dynamically allocate a 2D array in C? How to pass a 2D array as a parameter in C? How to write long strings in Multi-lines C/C++? What are the data types for which it is not possible to create an array? Variable Length Arrays in C and C++ Short hand array notation Accessing array out of bounds strcpy() in C/C++ strcmp() in C/C++ strdup() and strdndup() in C/C++ Pass an array by value Reverse a string in C/C++ strpbrk() in C strcoll() in C/C++ ispunct() in C strspn() in C isalpha() and isdigit() in C/C++ Control Statements: What should be data type of case labels of switch statement in C? For Versus While A nested loop puzzle switch statement in C Difference between while(1) and while(0) goto statement Continue Statement Break Statement Using range in switch case Functions: Functions in C Importance of function prototype in C Functions that are executed before and after main() in C return statement vs exit() in main() How to Count Variable Numbers of Arguments in C?, What is evaluation order of function parameters in C? Does C support function overloading? How can we return multiple values from a function? What is the purpose of a function prototype? Static functions in C exit(), abort() and assert() Implicit return type int in C What happens when a function is called before its declaration in C? _Noreturn function specifier in C exit() vs _Exit() __func__ identifier in C Callback function in C Nested functions in C Parameter Passing Techniques pow() function in C tolower() function in C time() function in C Pointers: Introduction to pointers in C and C++ Double Pointer (Pointer to Pointer) in C Why C treats array parameters as pointers? Output of the program | Dereference, Reference, Dereference, Reference Dangling, Void , Null and Wild Pointers An Uncommon representation of array elements How to declare a pointer to a function? Pointer vs Array in C void pointer in C NULL pointer in C ! Function Pointer in C near, far and huge pointers Generic Linked List in C restrict keyword in C const char *p, char * const p and const char * const p Pointer to an Array Enum, Struct and Union: Enum in C Structures in C Union in C Struct Hack Structure Member Alignment, Padding and Data Packing Operations on struct variables in C Bit Fields in C Structure Sorting (By Multiple Rules) in C++ Flexible array members in structure Difference between Structure and Union Difference between C structures and C++ structures Anonymous Union and Structure in C Compound Literals in C Memory Management: Memory Layout of C Programs, How to deallocate memory without using free() in C? calloc() versus malloc() How does free() know the size of memory to be deallocated? Use of realloc() What is Memory Leak? How can we avoid? File Handling: fseek() vs rewind() in C EOF, getc() and feof() in C fopen() for an existing file in write mode Read/Write structure to a file fgets() and gets() in C Basics of File Handling fsetpos() in C rename function in C/C++ tmpfile() function in C fgetc() and fputc() in C fseek() in C/C++ ftell() in C lseek() in C/C++ remove function in C/C++ Merge contents of two files into a third file Print contents of file in C Puzzles: C Program to print numbers from 1 to N without using semicolon? How to find sum of two numbers without using any operator How will you show memory representation of C variables? Condition To Print “HelloWord” Change/add only one character and print ‘*’ exactly 20 times How can we sum the digits of a given number in single statement? What is the best way in C to convert a number to a string? Calculate Logn in one line Print “Even” or “Odd” without using Conditional statement How will you print numbers from 1 to 100 without using loop? How can we sum the digits of a given number in single statement? How will you print “Geeks for Geeks” without using a semicolon Write a one line C function to round floating point numbers How will implement Your Own sizeof How to count set bits in a floating point number in C? How to change the output of printf() in main() ? How to find length of a string without string.h and loop in C? Implement your own itoa() Write a C program that does not terminate when Ctrl+C is pressed How to measure time taken by a function in C? Print a long int in C using putchar() only Convert a floating point number to string in C How to write a running C code without main()? Write your own memcpy() C program to print characters without using format specifiers C program to print a string without any quote (singe or double) in the program Execute both if and else statements simultaneously Print “Hello World” without using any header file Misc: Quine – A self-reproducing program Complicated declarations in C Use of bool in C Sequence Points in C | Set 1 Optimization Techniques | Set 2 (swapping), ASCII NUL, ASCII 0 (’0?) and Numeric literal 0 Little and Big Endian Mystery, Comparator function of qsort() in C Program to validate an IP address Multithreading in C Assertions in C/C++ fork() in C Interesting Facts in C Programming Precision of floating point numbers in C++ (floor(), ceil(), trunc(), round() and setprecision()) setjump() and longjump() in C nextafter() and nexttoward() in C/C++ pthread_cancel() in C pthread_equal() in C pthread_self() in C Local Labels in C lvalue and rvalue in C Get and set the stack size of thread attribute Difference between fork() and exec() Errors in C/C++ Why is C considered faster than other languages Incompatibilities between C and C++ Convert C/C++ code to assembly language Error Handling in C Executing main() in C/C++ : Behind the scene Hygienic Macros in C Command line arguments in C/C++ scanf(), fscanf(), sscanf(), scanf_s(), fscanf_s(), sscanf_s() Some Interesting Facts in C Programming Database Connectivity using C/C++ Function Interposition in C Macros vs Functions Write your own memcpy() and memmove() C Language Interview Questions Commonly Asked C Programming Interview Questions | Set 1 Commonly Asked C Programming Interview Questions | Set 2 C/C++ Programs Coding Practice Platform My Personal Notes arrow_drop_up Save Share your thoughts in the comments Add Your Comment Please Login to comment...