?
Solved

1<i

Posted on 2007-03-19
5
Medium Priority
?
140 Views
Last Modified: 2010-04-15
BitWise
int andmask;
             for(i = 15;i >=0;i--)
             {
                   andmask =int 1<i;
                    printf("\n **** AndMask : ",andmask);
             }


Question :
1 ) What is the Meaning of  " int 1 < i " ?
 
0
Comment
Question by:gauravflame
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 18746889
it casts the result of (1 < i)  which returns a boolean value into int, ie 0 (false) and -1 (false)
0
 

Author Comment

by:gauravflame
ID: 18746913
anything else is true ,except 0 & -1 which are false
I am right
0
 
LVL 143

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 200 total points
ID: 18746918
no. only 0 is evaluating to false. everything else (including -1) is true
0
 

Author Comment

by:gauravflame
ID: 18746925
fine , thanks
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you thought about creating an iPhone application (app), but didn't even know where to get started? Here's how: ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Important pre-programming comments: I’ve never tri…
This is a short and sweet, but (hopefully) to the point article. There seems to be some fundamental misunderstanding about the function prototype for the "main" function in C and C++, more specifically what type this function should return. I see so…
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use for-loops in the C programming language.
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use nested-loops in the C programming language.

718 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question