10 Replies - 19476 Views - Last Post: 22 February 2008 - 04:02 AM Rate Topic: ***-- 2 Votes

#1 Vvivek786   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 6
  • Joined: 16-February 08

to print a string "hello" without using semicolon

Posted 16 February 2008 - 10:07 PM

plz help
Is This A Good Question/Topic? 0
  • +

Replies To: to print a string "hello" without using semicolon

#2 no2pencil   User is offline

  • Professor Snuggly Pants
  • member icon

Reputation: 6968
  • View blog
  • Posts: 31,958
  • Joined: 10-May 07

Re: to print a string "hello" without using semicolon

Posted 16 February 2008 - 10:38 PM

Your topic has more text than your actual post. I would think that the topic would highlight the material of your post, not offer the main course.

Can you explain in more detail please?
Was This Post Helpful? 0
  • +
  • -

#3 Vvivek786   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 6
  • Joined: 16-February 08

Re: to print a string "hello" without using semicolon

Posted 16 February 2008 - 10:59 PM

View Postno2pencil, on 16 Feb, 2008 - 10:38 PM, said:

Your topic has more text than your actual post. I would think that the topic would highlight the material of your post, not offer the main course.

Can you explain in more detail please?

i want to write a program that prints "hello" on screen without using semicolon(;) in program
Was This Post Helpful? 0
  • +
  • -

#4 PennyBoki   User is offline

  • D.I.C Lover
  • member icon

Reputation: 55
  • View blog
  • Posts: 2,345
  • Joined: 11-December 06

Re: to print a string "hello" without using semicolon

Posted 16 February 2008 - 11:01 PM

If you want to do that in C or C++ I don't think you wil succeed because they are not scripting languages.
Hope this helps.

This post has been edited by PennyBoki: 16 February 2008 - 11:16 PM

Was This Post Helpful? 0
  • +
  • -

#5 no2pencil   User is offline

  • Professor Snuggly Pants
  • member icon

Reputation: 6968
  • View blog
  • Posts: 31,958
  • Joined: 10-May 07

Re: to print a string "hello" without using semicolon

Posted 16 February 2008 - 11:05 PM

View PostVvivek786, on 16 Feb, 2008 - 10:59 PM, said:

View Postno2pencil, on 16 Feb, 2008 - 10:38 PM, said:

Your topic has more text than your actual post. I would think that the topic would highlight the material of your post, not offer the main course.

Can you explain in more detail please?

i want to write a program that prints "hello" on screen without using semicolon(;) in program

The semi-colon is required for the end of any line that issues a function or command in C. So you can't issue anything without one. I wouldn't think that this can be done.
Was This Post Helpful? 0
  • +
  • -

#6 Bench   User is offline

  • D.I.C Lover
  • member icon

Reputation: 945
  • View blog
  • Posts: 2,464
  • Joined: 20-August 07

Re: to print a string "hello" without using semicolon

Posted 17 February 2008 - 02:05 AM

View PostVvivek786, on 17 Feb, 2008 - 05:59 AM, said:

i want to write a program that prints "hello" on screen without using semicolon(;) in program

In which case, I suggest you learn a different programming language. You can't make up the language rules as you go along.
Was This Post Helpful? 1
  • +
  • -

#7 manzoor   User is offline

  • D.I.C Regular
  • member icon

Reputation: 13
  • View blog
  • Posts: 468
  • Joined: 07-August 07

Re: to print a string "hello" without using semicolon

Posted 17 February 2008 - 02:17 AM

AFAIK, I think this isn't possible, correct me if I'm wrong
Was This Post Helpful? 0
  • +
  • -

#8 KYA   User is offline

  • Wubba lubba dub dub!
  • member icon

Reputation: 3213
  • View blog
  • Posts: 19,241
  • Joined: 14-September 07

Re: to print a string "hello" without using semicolon

Posted 17 February 2008 - 02:37 AM

The more important question is WHY would you want to do this? ><
Was This Post Helpful? 0
  • +
  • -

#9 selloorhari   User is offline

  • D.I.C Head

Reputation: 5
  • View blog
  • Posts: 68
  • Joined: 07-February 08

Re: to print a string "hello" without using semicolon

Posted 18 February 2008 - 05:52 AM

View PostVvivek786, on 16 Feb, 2008 - 10:07 PM, said:

plz help



Hi Vivek,

Check this code...
If I am Wrong .. Correct me ....

main()
{

	if ( printf ("Hello " )  )
	{
	 }

}


Was This Post Helpful? 1

#10 Amadeus   User is offline

  • g+ + -o drink whiskey.cpp
  • member icon

Reputation: 253
  • View blog
  • Posts: 13,507
  • Joined: 12-July 02

Re: to print a string "hello" without using semicolon

Posted 18 February 2008 - 06:35 AM

While not the prettiest of options, this sort of thing can be accomplished taking the printable string as a command line argument, and using a statement inside a control loop print, eliminating the need for a semi colon. An example is below.


http://answers.yahoo...11101631AAasFca
Was This Post Helpful? 0
  • +
  • -

#11 selloorhari   User is offline

  • D.I.C Head

Reputation: 5
  • View blog
  • Posts: 68
  • Joined: 07-February 08

Re: to print a string "hello" without using semicolon

Posted 22 February 2008 - 04:02 AM

View PostVvivek786, on 16 Feb, 2008 - 10:07 PM, said:

plz help


In which interview, you faced this funny question?

This post has been edited by selloorhari: 22 February 2008 - 04:03 AM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1