Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > if and for statements

Reply
Thread Tools

if and for statements

 
 
Paminu
Guest
Posts: n/a
 
      10-04-2005
is this:
....
....
....
for (i = 0; i <16; i++)
{
if (arg & j) a++;
j <<= 2;
}

return (a & 1);
....
....
....

the same as:
for (i = 0; i <16; i++)
{
if (arg & j)
{
a++;
}

j <<= 2;

}

return (a & 1);

 
Reply With Quote
 
 
 
 
mario.demiguel@gmail.com
Guest
Posts: n/a
 
      10-04-2005
Yes

 
Reply With Quote
 
 
 
 
Christopher Benson-Manica
Guest
Posts: n/a
 
      10-04-2005
http://www.velocityreviews.com/forums/(E-Mail Removed) wrote:

> Yes


It is proper Usenet etiquette to include the text you are replying to.
To do this using Google groups, please follow the instructions below,
penned by Keith Thompson:

If you want to post a followup via groups.google.com, don't use
the broken "Reply" link at the bottom of the article. Click on
"show options" at the top of the article, then click on the
"Reply" at the bottom of the article headers.

--
Christopher Benson-Manica | I *should* know what I'm talking about - if I
ataru(at)cyberspace.org | don't, I need to know. Flames welcome.
 
Reply With Quote
 
Default User
Guest
Posts: n/a
 
      10-04-2005
(E-Mail Removed) wrote:

> Yes


Yes, what?

--
Please quote enough of the previous message for context. To do so from
Google, click "show options" and use the Reply shown in the expanded
header.
 
Reply With Quote
 
Keith Thompson
Guest
Posts: n/a
 
      10-04-2005
"Default User" <(E-Mail Removed)> writes:
> (E-Mail Removed) wrote:
>
>> Yes

>
> Yes, what?


Yes, Sir?

--
Keith Thompson (The_Other_Keith) (E-Mail Removed) <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
 
Reply With Quote
 
Kenneth Brody
Guest
Posts: n/a
 
      10-04-2005
Paminu wrote:
>
> is this:

[... code that differs only at ...]

> if (arg & j) a++;


[...and...]

> if (arg & j)
> {
> a++;
> }


[... the same? ...]

Yes.

--
+-------------------------+--------------------+-----------------------------+
| Kenneth J. Brody | www.hvcomputer.com | |
| kenbrody/at\spamcop.net | www.fptech.com | #include <std_disclaimer.h> |
+-------------------------+--------------------+-----------------------------+
Don't e-mail me at: <(E-Mail Removed)>

 
Reply With Quote
 
Barry Schwarz
Guest
Posts: n/a
 
      10-05-2005
On Tue, 04 Oct 2005 21:45:44 +0200, Paminu <(E-Mail Removed)> wrote:

>is this:
>...
>...
>...
>for (i = 0; i <16; i++)
>{
> if (arg & j) a++;
> j <<= 2;
>}
>
>return (a & 1);
>...
>...
>...
>
>the same as:
>for (i = 0; i <16; i++)
>{
> if (arg & j)
> {
> a++;
> }


Yes. If the "range" of the if is a single statement, the braces are
optional.

>
> j <<= 2;
>
>}
>
>return (a & 1);



<<Remove the del for email>>
 
Reply With Quote
 
Peter Shaggy Haywood
Guest
Posts: n/a
 
      10-07-2005
Groovy hepcat Keith Thompson was jivin' on Tue, 04 Oct 2005 20:46:43
GMT in comp.lang.c.
Re: if and for statements's a cool scene! Dig it!

>"Default User" <(E-Mail Removed)> writes:
>> (E-Mail Removed) wrote:
>>
>>> Yes

>>
>> Yes, what?

>
>Yes, Sir?


Yes, Sir, three bags full, Sir.

--

Dig the even newer still, yet more improved, sig!

http://alphalink.com.au/~phaywood/
"Ain't I'm a dog?" - Ronny Self, Ain't I'm a Dog, written by G. Sherry & W. Walker.
I know it's not "technically correct" English; but since when was rock & roll "technically correct"?
 
Reply With Quote
 
pete
Guest
Posts: n/a
 
      10-07-2005
Peter Shaggy Haywood wrote:
>
> Groovy hepcat Keith Thompson was jivin' on Tue, 04 Oct 2005 20:46:43
> GMT in comp.lang.c.
> Re: if and for statements's a cool scene! Dig it!
>
> >"Default User" <(E-Mail Removed)> writes:
> >> (E-Mail Removed) wrote:
> >>
> >>> Yes
> >>
> >> Yes, what?

> >
> >Yes, Sir?

>
> Yes, Sir, three bags full, Sir.


One for the little boy who lives down the drain.

"Lane" was not in my vocabulary when I learned this.

--
pete
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
if statements and case statements questions John Crichton Ruby 6 07-12-2010 06:17 PM
Prepare Statements VS Statements Vince Java 12 01-21-2008 01:18 PM
component statements within architecture statements Neil Zanella VHDL 8 10-20-2006 09:05 AM
if statements with or w/o else statements Harry George Python 6 02-23-2004 06:48 PM
Re: Process and IF Statements spyros VHDL 0 07-19-2003 05:07 AM



Advertisments