Please support our C advertiser: Programming Forums
Views: 1128 | Replies: 7
![]() |
•
•
Join Date: Aug 2005
Location: near St Louis, Missouri, USA
Posts: 11,565
Reputation:
Rep Power: 40
Solved Threads: 977
any conditional statement that is either true or false. for example if you were asked to enter either 'Y' or 'N' (Yes or No) then the statement might read
if( answer == 'Y')
{
// true statement
}
else
{
// false statement
}•
•
Join Date: Feb 2007
Location: Bangalore, India
Posts: 535
Reputation:
Rep Power: 4
Solved Threads: 50
•
•
•
•
any conditional statement that is either true or false. for example if you were asked to enter either 'Y' or 'N' (Yes or No) then the statement might read
if( answer == 'Y') { // true statement } else { // false statement }
Thisnk it's a trick question. May be you didn't read it fully..
@mohiuddin.shaik
It is allowed to write/change anything other than ? e.g. can I use a goto inside the if block?
•
•
Join Date: Aug 2005
Location: near St Louis, Missouri, USA
Posts: 11,565
Reputation:
Rep Power: 40
Solved Threads: 977
you are right -- I didn't read the expected outcome, which is impossible. There is no solution that will give that outcome.
•
•
Join Date: Feb 2007
Location: Bangalore, India
Posts: 535
Reputation:
Rep Power: 4
Solved Threads: 50
•
•
•
•
you are right -- I didn't read the expected outcome, which is impossible. There is no solution that will give that outcome.
What abt GOTO LABEL?
c Syntax (Toggle Plain Text)
if ( true ) { cout << "Hi" << endl ; goto ELSE_PART ; } else { ELSE_PART: cout << " There" << endl ; }
of course that's cheating but then teh question is not fair..
Last edited by thekashyap : Mar 28th, 2007 at 12:23 pm.
Seems simple enough
int main()
{
if (!printf("welcome ")) {
printf("welcome");
} else {
printf("to ieg");
}
return 0;
}![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)






)
Linear Mode