If this blog helped you in any way, please donate a dollar here

Showing posts with label C. Show all posts
Showing posts with label C. Show all posts

Saturday, July 27, 2019

The Techgig C Skill Test

I used to consider myself to be pretty good in C, so I decided to try out the world's biggest programming contest platform, TechGiG (Look here: https://www.techgig.com), or so they claim to be. I wonder why I hadn't dabbled in this platform all this years since the platform seems to be existing for quite some time now. I do remember some 5-6 years ago I had dabbled a bit in the website and then stopped, I wonder why, can't really recall.

So I decided to give it a spin. I decided to try out the TechGig Skill test. Here's what I found while attempting the test.

There were 25 questions and I got 6 wrong and 19 correct. I wonder which ones I got wrong. Also considering some multiple choice answers didn't really answer the question. Also, I really wonder what a Java Question was doing in a C Skill test! Take a look:


Being the Java n00b, I might have messed that up. Moving on to one of the brilliant CHTML Questions in recent times.


That's an amazing blend of HTML and C. Amazing HTML coding skills are the feature of the tests in TechGig, since this sort of goof-up is pretty common.

Let's move on to the wrong answers now. I got this wrong apparently:


Well, I do pride myself in such questions, but seems like I have forgotten how printf handles the parse string! Well, what does ideone think?


Dear! O Dear! Ideone might have got it wrong too! Wait, maybe TechGig was wrong? Dare I say that!

Let's move to the next incorrect answer by me. Here we go:


Well, well, well. Seems like I've forgotten the basics of pointers! :( What does ideone think then ?


I think I've caught on by this point. I'm quite a C n00b also. Shall we see the next incorrect answer by me ?


This was quite tricky, so it's possible I might have messed up here. But really ?


By this point I'm convinced that the compiler used by ideone is perhaps broken. Or maybe it's TechGig that sucks?

I'll leave it to you, the reader to figure that out.

Tuesday, June 7, 2011

Devhelp documentation for C

Standard C Library documentation can be easily found on the command line via the terminal. Do a simple 'man scanf' and you get the entire documentation for the function. This functionality requires the appropriate manual pages to be installed which is part of the standard C library documentation.

Dev-Help is a documentation viewer for GNOME and has various books to be used by developers. Standard repositories of Ubuntu, LinuxMint and Debian contains many devhelp books but a notable exception is the Standard C Library Documentation

Thursday, September 23, 2010

Obfuscated Code Contest

Obfuscation is an art. It refers to making your code hard to read... hard to understand using advanced concepts. So, let me present a code that prints my name, but in an obfuscated manner! This was done by me a couple of years ago, but was faulty. I corrected it and here it is:

float m[] = {2.94576846098867283087373218349056E+32, 3.761396E+24, 9.316795E-39 };
main(){printf(m);}

Magic eh? Nope... just an understanding of data types.

The concept here is pretty simple. Data representation is exploited. Don't think IEEE754 here, since this can be made with a simpler technique. So.. let me ask my readers... what technique can be used to generate the number?

I am giving away a prize for the person who answers this first and correctly. Best of Luck!