Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. The Lounge
  3. I also got a C puzzle

I also got a C puzzle

Scheduled Pinned Locked Moved The Lounge
question
6 Posts 5 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • U Offline
    U Offline
    utsav_verma
    wrote on last edited by
    #1

    Well, once a person through a challenge to me, write any line in C without using semi colon i.e. ; any idea?? I guess, using assembly its possible. Let me b more clear after many COOL solutions - i mean printing a line, as we do thru printf Utsav

    N R S O 4 Replies Last reply
    0
    • U utsav_verma

      Well, once a person through a challenge to me, write any line in C without using semi colon i.e. ; any idea?? I guess, using assembly its possible. Let me b more clear after many COOL solutions - i mean printing a line, as we do thru printf Utsav

      R Offline
      R Offline
      Rocky Moore
      wrote on last edited by
      #2

      /* Any Line */ Rocky <>< Yahoo! 360º - Try it yourself![^]

      1 Reply Last reply
      0
      • U utsav_verma

        Well, once a person through a challenge to me, write any line in C without using semi colon i.e. ; any idea?? I guess, using assembly its possible. Let me b more clear after many COOL solutions - i mean printing a line, as we do thru printf Utsav

        N Offline
        N Offline
        Nu Er Ha Chi
        wrote on last edited by
        #3

        Here is an entire program without semi colon: void main() {} ;P

        N 1 Reply Last reply
        0
        • U utsav_verma

          Well, once a person through a challenge to me, write any line in C without using semi colon i.e. ; any idea?? I guess, using assembly its possible. Let me b more clear after many COOL solutions - i mean printing a line, as we do thru printf Utsav

          S Offline
          S Offline
          SHaroz
          wrote on last edited by
          #4

          A blank line is legitimate in C. Comments also don't need semicolons, and neither do precompiler statements (i.e. #define, #include). The first line of an if or while statement doesn't need a semicolon. As a matter of fact, any statement could simply be written with the semicolon on the next line. :| Am I missing something?

          1 Reply Last reply
          0
          • N Nu Er Ha Chi

            Here is an entire program without semi colon: void main() {} ;P

            N Offline
            N Offline
            Nu Er Ha Chi
            wrote on last edited by
            #5

            #include <stdio.h> void main() {   if(printf("Hello, world")) {} }

            1 Reply Last reply
            0
            • U utsav_verma

              Well, once a person through a challenge to me, write any line in C without using semi colon i.e. ; any idea?? I guess, using assembly its possible. Let me b more clear after many COOL solutions - i mean printing a line, as we do thru printf Utsav

              O Offline
              O Offline
              ogrig
              wrote on last edited by
              #6

              void foobar (int noNumber) {} even int main (int argc, char* argv []) { } is accepted by many compilers apart from that, any empty block is just fine {} You can do everything with macros, but that's just cheating, the semi colon is a statement terminator in C (unlike Pascal, where it is a statement delimiter), so you would need them in the maco definition another option would be to use the intialization list in the constructor OGR

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups