Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

c code

Posted on 2003-12-05
6
Medium Priority
?
374 Views
Last Modified: 2010-04-15
Is that i can printf something on console using code which should'nt have semicolon,

May be its stupid question,Pls give hints


chiku
0
Comment
Question by:chikucoder
  • 3
  • 2
6 Comments
 
LVL 45

Expert Comment

by:sunnycoder
ID: 9881911
I remember seeing this one

hint : if ( ... ) does not need semicolon inside and printf returns something ... Damn. I cant recollect the answer ... will try to punch out a few things
0
 
LVL 45

Accepted Solution

by:
sunnycoder earned 200 total points
ID: 9881961
finally got it

#include <stdio.h>

int main()
{
         switch ( printf ("abc") > 0  )
         {
         }

               
}
0
 
LVL 11

Expert Comment

by:bcladd
ID: 9882215
sunnycoder-

Don't actually need the "> 0" since printf returns an integral value.
Cool trivia.

-bcl
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 45

Expert Comment

by:sunnycoder
ID: 9882231
yeah realized that .... was just fumbling with variations of if () when idea of switch struck ... posted in hurry
0
 
LVL 11

Expert Comment

by:bcladd
ID: 9882275
Be a fun interview question: In standard C (or standard C++) write the "Hello, World!" program without using a semicolon.

Or: Your computer's semicolon key is non-operative and you've been asked to demonstrate writing the ubiquitous "Helllo, World!" program in C/C++ for the CEO's young daughter. Do what you can to keep your job; no pressure.

-bcl
0
 
LVL 1

Author Comment

by:chikucoder
ID: 9882536
Sunny

Suggest me some good kindergarten c school
I guess i have to start from scartch

yeah blc it was interview qts
0

Featured Post

Technology Partners: 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 tutorial is posted by Aaron Wojnowski, administrator at SDKExpert.net.  To view more iPhone tutorials, visit www.sdkexpert.net. This is a very simple tutorial on finding the user's current location easily. In this tutorial, you will learn ho…
The goal of this video is to provide viewers with basic examples to understand opening and reading files in the C programming language.
The goal of this video is to provide viewers with basic examples to understand and use conditional statements in the C programming language.

885 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