Welcome Guest ( Log In | Register )



 
Reply to this topicStart new topic
> C Puzzles
sureshkmit
post Jan 7 2008, 06:25 AM
Post #1


Newbie [ Level 1 ]
Group Icon

Group: Members
Posts: 2
Joined: 7-January 08
Member No.: 27,420



Thanks for your interest in C programming. Here, you will find a list of interesting C programming questions/puzzles. C is the basic language for all who are in the computer science field. You can post new c questions and puzzles. Please try to avoid the duplicates.
I hope that this will be very interesting and meaningful for "C" programmers.

Lets us start with simple question.

----------------------------------------------------------------------------------------------------------------------------------------------------
CODE
#include<stdio.h>
  int main()
  {
          int a=10;
          switch(a)
          {
                  case '1':
                      printf("ONE\n");
                      break;
                  case '2':
                      printf("TWO\n");
                      break;
                  defa1ut:
                      printf("NONE\n");
          }
          return 0;
  }


If you expect "NONE" is the output, u are wrong. Wats the output & How?
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic

Collapse

> Similar Topics

Topics Topics
  1. Love Puzzles & Da Vinci Code? Enter Contest(2)


 



- Lo-Fi Version Time is now: 6th September 2008 - 08:31 PM