What are some mind blowing C programs?

Hello Readers,

You may have played around a lot using C language during your college days in labs. Let’s dive back to those days and check out few of those.

Below are some of the mind blowing C programs:

This program will print 1 to 100 without using any loop and recursion.

int i;
void b(){
void c(){
void a(){
void main(){

Print hello without using any semicolon in the program.

1st method:

void main(){
switch(printf("hello")) {}

2nd method:

#define PRINT printf("hello")
void main(){

3rd method:

void main(){

Program to print “Hello Quora” using if and else both statement.

#include <stdio.h>
void main(){
if(!printf("Hello "));
else printf("Quora\n");

C Program to print source code as program output

#include <stdio.h>
int main(void){
FILE *fp;
char c;
fp = fopen(__FILE__, "r");
do { c=fgetc(fp); putchar(c); }
while(c!=EOF); fclose(fp);
return 0;

Output (above source code is output):

mind blowing C programs

Credits: This article has been taken from Quora: Nitin Goswami’s Answer

What do you think?

Dear Reader,
If you have any questions or suggestions please feel free to email us or put your thoughts as comments below. I would love to hear from my readers. Please share along with your friends and help them to learn.

Keep Learning!