Print Map of India C Program

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)

Method 2: C Program To Display Map of India using For Loop

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.

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

C Program To Print Map of India with Obfuscated Code

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.

Recommended Programs
1Code To Delete Vowels in a String in C Programming
2Find Armstrong Number in C Programming
3C Program To Replace A Character In A String
4C Program To Find Arithmetic Progression
5C Program To Count Trailing Zeros in an Integer
6C Program To Implement FCFS Algorithm

9 thoughts on “Print Map of India C Program

  1. THUN SEY

    Excuse me please tell me how to learn c program clearly and easy because now i’m first year of IT

    Reply
    1. Tushar Soni Post author

      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!

      Reply
  2. Dipak Kale

    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.

    Reply
  3. Ashraf Jawadi

    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?

    Reply
  4. Akshay Patve

    I liked the For Loop method to print map of India in C. It is much easier than the first method.

    Reply
  5. Raju Saigal

    Thanks for explaining us how this C program to print India’s map works. It is just so simplex and interesting.

    Reply

Let's Discuss