C Program Code To Print Map of India
Here’s a Code To Print Map of India in C Programming Language using For loop. This program code is an example of Obfuscated Code in C programming language.
Objectives of Obfuscated Code
- To create a program code in an unusual way and thereby emphasizing on programming style in an ironic method.
- To create a program that resembles images, text and unusual characters that you may think of.
- To write the an obscure program code in C programming language which are within the rules of the language.
- To force the C compiler to execute with unusual codes and thereby making rarely used code combinations.
- To show the importance of programming style, in an ironic way.
- To make use of pre-processors which thereby makes the code harder to read.
Method 1: Code To Print Map of India in C Programming (Obfuscated Code)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | #include <stdio.h> void main() { int x, y, z; int c = 1; for (y = z = 10; x = "- FIGURE?, UMKC,XYZHello Folks,\ TFy!QJu ROo TNn(ROo)SLq SLq ULo+\ UHs UJq TNn*RPn/QPbEWS_JSWQAIJO^\ NBELPeHBFHT}TnALVlBLOFAkHFOuFETp\ HCStHAUFAgcEAelclcn^r^r\\tZvYxXy\ T|S~Pn SPm SOn TNn ULo0ULo#ULo-W\ Hq!WFs XDt!" [y+++21]; ) for(; x-- > 64 ; ) putchar ( ++z == 'Z' ? z = z/ 9:33^y&1); } |
Method 2: C Program To Display Map of India using For Loop
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | #include <stdio.h> void main() { int x, y, z; int i = 1; for (y = z = 10; x = "- FIGURE?, UMKC,XYZHello Folks,\ TFy!QJu ROo TNn(ROo)SLq SLq ULo+\ UHs UJq TNn*RPn/QPbEWS_JSWQAIJO^\ NBELPeHBFHT}TnALVlBLOFAkHFOuFETp\ HCStHAUFAgcEAelclcn^r^r\\tZvYxXy\ T|S~Pn SPm SOn TNn ULo0ULo#ULo-W\ Hq!WFs XDt!" [y+++21]; ) for(; x-- > 64 ; ) { ++z; if (z == 90) { z = 10; putchar('\n'); } else { if (y % 2 == 0) putchar('!'); else putchar(' '); } } } |
How Does This Obfuscated Version Work?
Basically, the String is a Run Length Encoding of the Image i.e., India’s Map. In the Second Method, we have written putchar() method in a different way which helps to understand the Code even better.
1 2 3 4 5 6 7 | for (y = z = 10; x = "- FIGURE?, UMKC,XYZHello Folks,\ TFy!QJu ROo TNn(ROo)SLq SLq ULo+\ UHs UJq TNn*RPn/QPbEWS_JSWQAIJO^\ NBELPeHBFHT}TnALVlBLOFAkHFOuFETp\ HCStHAUFAgcEAelclcn^r^r\\tZvYxXy\ T|S~Pn SPm SOn TNn ULo0ULo#ULo-W\ Hq!WFs XDt!" [y+++21]; ) |
The String that is defined in multiple lines is actually a Binary Series that is converted to ASCII Values. The String is interpreted as an Array of Characters. Obfuscated Codes are very difficult to understand. The String, therefore, contains the Instructions to Draw India’s Map in C Programming.
The For Loop – for (y = z = 10; x = “…) assigns y with 10 and y+++21. This C Program Code works with Bit Conversion. The Binary 1 is converted into Exclamation (!) and the Binary 0 is converted into a Whitespace ( ) character, thereby printing one character at a given point of time. The String, which is the Run Length Encoding behaves as an Array which makes the start of the data from 31 onwards.
Output

If you have any compilation errors with this C Program to Print Map of India with Obfuscated coding style or if you have any doubts, mention about it in the comment section below.
how to make map of Cambodia ??? Excuse me please tell me.I want to know it. sey_thun@yahoo.com
and tychandra178@gmail.com
Excuse me please tell me how to learn c program clearly and easy because now i’m first year of IT
Just focus on one programming book! Once you get your basics right, then all the other languages would be easy for you!
1. Get one good programming book.
2. Don’t Mug Up the Programs! Try to understand it. It is a little difficult though.
3. Refer websites based on C Programming and practice as much codes as possible!
Pls can u say name of books and websites
What a fantastic program to display map of india in c. Although, the obfuscated codes are difficult to understand, but your explanation has helped to understand a little bit.
This is amazing. How did you do that? I am trying to build map of Afghanistan in C Programming? Can I manipulate Map of India?
I liked the For Loop method to print map of India in C. It is much easier than the first method.
Thanks for explaining us how this C program to print India’s map works. It is just so simplex and interesting.
Can you explain the for loop in detail ?