Search the web
Sign In
New User? Sign Up
Programmers-Town
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Want your group to be featured on the Yahoo! Groups website? Add a group photo to Flickr.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
a question   Message List  
Reply | Forward Message #12339 of 12634 |
Re: (PT) a question

On Fri, Jan 2, 2009 at 5:36 AM, Akter Suriya <aktersuriya@...> wrote:
> Chetna,
> in that case also both parts will not execute at all.

Um - wrong. The first part (only) will be executed.

> Akter Yakub Suriya
>
>
> On Wed, Dec 31, 2008 at 9:55 AM, Chetna Bhute <chetnabhute@...> wrote:
>
>> i guess ur interviewer was looking at following answer:
>>
>> if (a=10) /*note: a=10 will not do any comparison but assignment*/
>> printf("In if part...");
>> else
>> printf("In else part...");
>>
>> On Fri, Dec 26, 2008 at 3:24 PM, kirtibeniwal
<kirtibeniwal@...<kirtibeniwal%40yahoo.com>
>> >wrote:
>>
>>
>> > HI I HAVE A QUESTION IN MY MIND ABOUT C LANGUAGE SINCE A MONTH I HOPE
>> > U WILL SURELY ANSWER MY QUESTION.
>> > "IN C PROGRAM CONTAING IF-ELSE CONDITION IS THERE ANY STATEMENT WHICH
>> > WILL ENABLE THE COMPLIER TO EXECUTE BOTH IF AND ELSE STATEMENT?"
>> > THIS WAS THE QUESTION ASKED BY SOME EXTERNAL DURING PLACEMENTS IN SOME
>> > COLLEGE.
>> > I AM VERY EAGER TO KNOW THE ANSWER. PLEASE REPLY SOON.
>> > KIRTIBENIWAL

--
PJH

http://shabbleland.myminicity.com/ind



Mon Jan 5, 2009 10:55 pm

shabble
Offline Offline
Send Email Send Email

Forward
Message #12339 of 12634 |
Expand Messages Author Sort by Date

HI I HAVE A QUESTION IN MY MIND ABOUT C LANGUAGE SINCE A MONTH I HOPE U WILL SURELY ANSWER MY QUESTION. "IN C PROGRAM CONTAING IF-ELSE CONDITION IS THERE ANY...
kirtibeniwal
Offline Send Email
Dec 27, 2008
7:03 pm

Hi Kirti,   First of all there is no such statement in the compiler that will enable both the if statements & the else statements . As the purpose of the if...
deepak mittal
mittal_d2003
Offline Send Email
Dec 29, 2008
6:39 pm

Hi, As far as i know there is no compiler directive for executing both the If and else statements in C language, but i can tell u that there are something like...
sanjayraohn
Offline Send Email
Dec 29, 2008
6:40 pm

Hi, The only way to have both the conditions executed is by having the condition that "if" evaluates be the same as that what "if" block would execute. e.g. ...
RM
lookforme30
Offline Send Email
Dec 30, 2008
7:01 pm

... condition that "if" evaluates be the same as that what "if" block would execute. ... part. Such constructs would have no real work usage. ... Where have...
kocmotex
Offline Send Email
Jan 2, 2009
4:48 am

i guess ur interviewer was looking at following answer: if (a=10) /*note: a=10 will not do any comparison but assignment*/ printf("In if part..."); else...
Chetna Bhute
chetnabhute@...
Send Email
Jan 2, 2009
4:49 am

Chetna, in that case also both parts will not execute at all. Akter Yakub Suriya ... -- [Non-text portions of this message have been removed]...
Akter Suriya
akter2suriya
Offline Send Email
Jan 2, 2009
7:25 pm

... Um - wrong. The first part (only) will be executed. ... -- PJH http://shabbleland.myminicity.com/ind...
Paul Herring
shabble
Offline Send Email
Jan 5, 2009
10:55 pm

First of all this is a pretty useless interview question. Doesn't check any c skills. And again the solution given below will not execute the "else" part! ...
Santosh Vernekar
santosh_ver2004
Offline Send Email
Jan 2, 2009
7:25 pm

Agreed with Santhosh. You can ask the interviewer, the need for doing so. If your CPU executes both the if and else part, then there is no use of making if...
madhansansel
Online Now Send Email
Jan 5, 2009
12:28 pm

Hi, I am able to compile & run the program , You have done some basic mistakes, My program is #include<stdio.h> int main() { if(!printf("HI")) { ; } else { ...
deepak mittal
mittal_d2003
Offline Send Email
Jan 8, 2009
3:36 pm

This is use less question , there is no possiblity that both if and else should execute if its , then there is no use of if and else. ... From: madhansansel...
Aijaz ahmad
ahmadlko
Offline Send Email
Jan 8, 2009
3:37 pm

from manish.patole@... hi chetna u ask me Q abt if - else statement ur answer : only if checks the condition if condition is true then statment...
Manish Patole
manish.patole
Offline Send Email
Jan 5, 2009
12:27 pm

Hi,   I am not sure the need for it....   However you can try with goto stmts. I didnt compile the program.   if (1)  {     printf("Executing If Part...
madhan sankar
madhansansel
Online Now Send Email
Jan 6, 2009
9:55 am
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help