Interesting Facts in C Programming | Set 2 Last Updated : 01 Oct, 2024 Comments Improve Suggest changes Like Article Like Report Below are some more interesting facts about C programming: 1. Macros can have unbalanced braces: When we use #define for a constant, the preprocessor produces a C program where the defined constant is searched and matching tokens are replaced with the given expression. Example: C #include <stdio.h> // Declaring Macro // with unbalanced brackets #define P printf( int main() { int a; P"Hello World"); P"%d", a); return 0; } OutputHello World02. Use main to declare one or more integer variables:Example: C #include <stdio.h> int main(int c) { for (; ++c < 28;) putchar(95 + c); return 0; } Outputabcdefghijklmnopqrstuvwxyz3. "%m" when used within printf() prints "Success"m (conversion specifier) is not C but is a GNU extension to printf. The ‘%m’ conversion prints the string corresponding to the error code in errno. %m only prints "Success" when "errno == 0" (it's short for a string representation of the last observed error state). For example, if a function fails before the printf, then it will print something rather different. Example: C #include <stdio.h> int main() { printf("%m"); return 0; } OutputSuccess4. brk(0); can be used as an alternative for return 0;brk() and sbrk() change the location of the program break, which defines the end of the process's data segment. Example: C #include <stdio.h> int main() { printf("%m"); brk(); } OutputSuccess5. C program can be written without main() Logically it seems impossible to write a C program without using a main() function. Since every program must have a main() function because:- It’s an entry point of every C/C++ program.All Predefined and User-defined Functions are called directly or indirectly through the main. But in reality, it is possible to run a C program without a main function. C #include <stdio.h> #include <stdlib.h> // entry point function int nomain(); void _start() { // calling entry point nomain(); exit(0); } int nomain() { puts("Geeksforgeeks"); return 0; } Compilation using the command:gcc filename.c -nostartfiles(nostartfiles option tells the compiler to avoid standard linking) Comment More infoAdvertise with us Next Article Interesting Facts in C Programming | Set 2 A AmiyaKarmakar Follow Improve Article Tags : GBlog Algorithms C Programs Articles DSA +1 More Practice Tags : Algorithms Similar Reads Commonly Asked C Programming Interview Questions | Set 3 Q.1 Write down the smallest executable code? Ans. main is necessary for executing the code. Code is C void main() { } Output Q.2 What are entry control and exit control loops? Ans. C support only 2 loops: Entry Control: This loop is categorized in 2 part a. while loop b. for loopExit control: In thi 5 min read Output of C programs | Set 66 (Accessing Memory Locations) Q1. Is the output of this code True or False? C #include <stdio.h> int main(void) { int b = 20; int* y = &b; char n = 'A'; char* z = &n; y[0] = z[0]; printf((*y == *z) ? "True" : "False"); } A. True B. False C. Program would crash D. Compilation error Answer: A. Tru 7 min read C Exercises - Practice Questions with Solutions for C Programming The best way to learn C programming language is by hands-on practice. This C Exercise page contains the top 30 C exercise questions with solutions that are designed for both beginners and advanced programmers. It covers all major concepts like arrays, pointers, for-loop, and many more.So, Keep it Up 12 min read String C/C++ Programs C program to swap two StringsC Program to Sort an array of names or stringsC Program to Check if a Given String is PalindromeC/C++ Program for Return maximum occurring character in the input stringC/C++ Program for Remove all duplicates from the input string.C/C++ Program for Print all the duplicate 3 min read C/C++ Programs sArray C/C++ ProgramsC Program to find sum of elements in a given arrayC program to find largest element in an arrayRecursive C program to linearly search an element in a given arrayC program to multiply two matricesC/C++ Program for Given an array A[] and a number x, check for pair in A[] with sum 15+ min read Array C/C++ Programs C Program to find sum of elements in a given arrayC program to find largest element in an arrayC program to multiply two matricesC/C++ Program for Given an array A[] and a number x, check for pair in A[] with sum as xC/C++ Program for Majority ElementC/C++ Program for Find the Number Occurring Odd N 6 min read C Multiple Choice Questions C is the most popular programming language developed by Dennis Ritchie at the Bell Laboratories in 1972 to develop the UNIX operating systems. It is a general-purpose and procedural programming language. It is faster than the languages like Java and Python. C is very versatile it can be used in both 4 min read C Programs To learn anything effectively, practicing and solving problems is essential. To help you master C programming, we have compiled over 100 C programming examples across various categories, including basic C programs, Fibonacci series, strings, arrays, base conversions, pattern printing, pointers, and 8 min read Getting started with C C language is a popular programming language that was developed in 1970 by Dennis Ritchie at Bell Labs. The C programming language was developed primarily to build the UNIX operating system. It is widely used because it is simple, powerful, efficient, and portable. Features of C Programming Language 5 min read ASCII Value of a Character in C In this article, we will discuss about the ASCII values that are bit numbers used to represent the character in the C programming language. We will also discuss why the ASCII values are needed and how to find the ASCII value of a given character in a C program.Table of ContentWhat is ASCII Value of 4 min read Like