Thread: can any one help me plz!!! what does this means???

  1. #1
    Registered User
    Join Date
    Nov 2011
    Posts
    82

    can any one help me plz!!! what does this means???

    while(i-1?++i:j--)
    Code:
    int main()     {              int i=-4,j=-2; while(i-1?++i:j--) printf("%d",i); getch (); return 0; }
    and y the output is -3 here??

    Code:
    #include<stdio.h>
    #include<conio.h>
    
        int main(){
    int i=12;
    for(i=100; i > -4; i-=2);
    printf("%d", ++i);
    getch();
    return 0;
    }
    Last edited by fredsilvester93; 12-11-2011 at 01:40 PM.

  2. #2
    Banned
    Join Date
    Aug 2010
    Location
    Ontario Canada
    Posts
    9,547
    It's a different form of if/else...

    Outside of the while loop...
    Code:
     x = i -1 ? ++i : j--;
    
    // translates to
    
    if( i -1)
      ++i;
    else
      j--;
    It test the value of i-1 if it's non-0 it incremeints i or if it's 0 it decrments j...

    Stuffing it into a while loop like that is simply waiting for either i or j to hit 0 ....
    But it's also a sure sign of someone trying to be way too clever.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. what does ROL means
    By bubblegum in forum C Programming
    Replies: 0
    Last Post: 03-08-2008, 09:20 AM
  2. What does the following means?
    By EeeK in forum C Programming
    Replies: 2
    Last Post: 10-27-2003, 10:15 PM
  3. Anyone know what this means?
    By bigblack in forum C++ Programming
    Replies: 1
    Last Post: 04-15-2002, 07:19 PM
  4. Does anyone know what this means
    By killerasp in forum C++ Programming
    Replies: 3
    Last Post: 02-08-2002, 01:41 AM
  5. What this SQL means ?
    By manova in forum C++ Programming
    Replies: 2
    Last Post: 12-16-2001, 02:02 PM