473,396 Members | 1,749 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Hello World

Hello World!
Nov 14 '05 #1
14 2213
In 'comp.lang.c', <ja****@citiz.net> wrote:
Hello World!


Wrong. It's

#include <stdio.h>

int main ()
{
puts ("Hello World!");
return 0;
}

--
-ed- get my email here: http://marreduspam.com/ad672570
The C-language FAQ: http://www.eskimo.com/~scs/C-faq/top.html
C-reference: http://www.dinkumware.com/manuals/reader.aspx?lib=c99
FAQ de f.c.l.c : http://www.isty-info.uvsq.fr/~rumeau/fclc/
Nov 14 '05 #2
On Sat, 15 May 2004 07:50:56 +0000, Emmanuel Delahaye wrote:
In 'comp.lang.c', <ja****@citiz.net> wrote:
Hello World!


Wrong. It's

#include <stdio.h>

int main ()
{
puts ("Hello World!");
return 0;
}


Or, if you want to annoy someone:

#include <stdio.h>

int main(void)
{
do { puts("Hello, world!"); } while(1);
return 0;
}

;)

(Interestingly, more than a few programming examples seem to think the
Hello, world! program /should/ be an infinite loop. I have no idea why.)

--
yvoregnevna gjragl-guerr gjb-gubhfnaq guerr ng lnubb qbg pbz
To email me, rot13 and convert spelled-out numbers to numeric form.
"Makes hackers smile" makes hackers smile.

Nov 14 '05 #3
August Derleth wrote:
.... snip ...
#include <stdio.h>

int main(void)
{
do { puts("Hello, world!"); } while(1);
return 0;
}


Since the return never gets executed, is the program correct under
C90 if the line is elided?

Chuck, making trouble.

--
"I'm a war president. I make decisions here in the Oval Office
in foreign policy matters with war on my mind." - Bush.
"Churchill and Bush can both be considered wartime leaders, just
as Secretariat and Mr Ed were both horses." - James Rhodes.
Nov 14 '05 #4
August Derleth <se*@sig.now> wrote:.

Or, if you want to annoy someone:

#include <stdio.h>

int main(void)
{
do { puts("Hello, world!"); } while(1);
return 0;
}
I think the "return 0;" is superfluous here (and may even generate
a compiler warning for unreachable code).
(Interestingly, more than a few programming examples seem to think the
Hello, world! program /should/ be an infinite loop. I have no idea why.)


10 PRINT "HELLO"
20 GOTO 10
Nov 14 '05 #5
"Old Wolf" <ol*****@inspire.net.nz> wrote in message
news:84**************************@posting.google.c om...
August Derleth <se*@sig.now> wrote:.

Or, if you want to annoy someone:

#include <stdio.h>

int main(void)
{
do { puts("Hello, world!"); } while(1);
return 0;
}


I think the "return 0;" is superfluous here (and may even generate
a compiler warning for unreachable code).
(Interestingly, more than a few programming examples seem to think the
Hello, world! program /should/ be an infinite loop. I have no idea why.)


10 PRINT "HELLO"
20 GOTO 10


Because there are so many people in the World...?

--
Mabden
Nov 14 '05 #6
> (Interestingly, more than a few programming examples seem to think the
Hello, world! program /should/ be an infinite loop. I have no idea why.)


That's called flooding. ;)
Nov 14 '05 #7
In <40***************@yahoo.com> CBFalconer <cb********@yahoo.com> writes:
August Derleth wrote:
... snip ...

#include <stdio.h>

int main(void)
{
do { puts("Hello, world!"); } while(1);
return 0;
}


Since the return never gets executed, is the program correct under
C90 if the line is elided?


Most definitely yes. Depending on your particular definition of program
correctness, it could be *always* elided: its removal doesn't invoke
undefined behaviour and doesn't require a diagnostic.
Chuck, making trouble.


Failed attempt ;-)

Dan
--
Dan Pop
DESY Zeuthen, RZ group
Email: Da*****@ifh.de
Nov 14 '05 #8
Old Wolf wrote:
August Derleth <se*@sig.now> wrote:.
Or, if you want to annoy someone:

#include <stdio.h>

int main(void)
{
do { puts("Hello, world!"); } while(1);
return 0;
}

I think the "return 0;" is superfluous here (and may even generate
a compiler warning for unreachable code).

(Interestingly, more than a few programming examples seem to think the
Hello, world! program /should/ be an infinite loop. I have no idea why.)

10 PRINT "HELLO"
20 GOTO 10


Funny how a simple, probably troll, post can yield a discussion in it of
itself.
Nov 14 '05 #9
Old Wolf wrote:
August Derleth <se*@sig.now> wrote:.
Or, if you want to annoy someone:

#include <stdio.h>

int main(void)
{
do { puts("Hello, world!"); } while(1);
return 0;
}

I think the "return 0;" is superfluous here (and may even generate
a compiler warning for unreachable code).

(Interestingly, more than a few programming examples seem to think the
Hello, world! program /should/ be an infinite loop. I have no idea why.)

10 PRINT "HELLO"
20 GOTO 10


10 PRINT "GOODBYE"
20 GOSUB 10

It's been a long time..
--
Joe Wright mailto:jo********@comcast.net
"Everything should be made as simple as possible, but not simpler."
--- Albert Einstein ---
Nov 14 '05 #10
ol*****@inspire.net.nz (Old Wolf) wrote:
August Derleth <se*@sig.now> wrote:.

<snip>
(Interestingly, more than a few programming examples seem to think the
Hello, world! program /should/ be an infinite loop. I have no idea why.)


10 PRINT "HELLO"
20 GOTO 10


program Nikolaus;

var
there_is_a_cold_day_in_hell : integer;

begin
there_is_a_cold_day_in_hell := 0;
repeat
writeln('Wotsit Wirth');
until there_is_a_cold_day_in_hell;
end.

<g,d&rf>

Regards
--
Irrwahn Grausewitz (ir*******@freenet.de)
welcome to clc: http://www.ungerhu.com/jxh/clc.welcome.txt
clc faq-list : http://www.faqs.org/faqs/C-faq/faq/
clc OT guide : http://benpfaff.org/writings/clc/off-topic.html
Nov 14 '05 #11
Irrwahn Grausewitz <ir*******@freenet.de> scribbled the following:
ol*****@inspire.net.nz (Old Wolf) wrote:
August Derleth <se*@sig.now> wrote:. <snip>
(Interestingly, more than a few programming examples seem to think the
Hello, world! program /should/ be an infinite loop. I have no idea why.)


10 PRINT "HELLO"
20 GOTO 10

program Nikolaus; var
there_is_a_cold_day_in_hell : integer; begin
there_is_a_cold_day_in_hell := 0;
repeat
writeln('Wotsit Wirth');
until there_is_a_cold_day_in_hell;
end. <g,d&rf>


Unlike C, Pascal has an explicit boolean type, and does not implicitly
convert integers into booleans. Therefore the above code won't even
compile.

--
/-- Joona Palaste (pa*****@cc.helsinki.fi) ------------- Finland --------\
\-- http://www.helsinki.fi/~palaste --------------------- rules! --------/
"The obvious mathematical breakthrough would be development of an easy way to
factor large prime numbers."
- Bill Gates
Nov 14 '05 #12
Joona I Palaste <pa*****@cc.helsinki.fi> wrote:
Irrwahn Grausewitz <ir*******@freenet.de> scribbled the following:
ol*****@inspire.net.nz (Old Wolf) wrote:
August Derleth <se*@sig.now> wrote:. <snip>
(Interestingly, more than a few programming examples seem to think the
Hello, world! program /should/ be an infinite loop. I have no idea why.)
<snip> var
there_is_a_cold_day_in_hell : integer; [...] until there_is_a_cold_day_in_hell;

[...]
Unlike C, Pascal has an explicit boolean type, and does not implicitly
convert integers into booleans. Therefore the above code won't even
compile.


You're right; my Pascal days are long since over, and I had to think
hard to recall at least some of its obtuse syntax. 'Twas a silly joke
anyway...

Regards
--
Irrwahn Grausewitz (ir*******@freenet.de)
welcome to clc: http://www.ungerhu.com/jxh/clc.welcome.txt
clc faq-list : http://www.faqs.org/faqs/C-faq/faq/
clc OT guide : http://benpfaff.org/writings/clc/off-topic.html
Nov 14 '05 #13
> > 10 PRINT "HELLO"
20 GOTO 10


10 PRINT "GOODBYE"
20 GOSUB 10

It's been a long time..


Wow, I haven't seen it for ages!

RUN

-ZZ
Nov 14 '05 #14
Irrwahn Grausewitz wrote:

<snip>

program Nikolaus;
error: use "program Nikolaus(output);"

var
there_is_a_cold_day_in_hell : integer;
should be: "there_is_a_cold_day_in_hell : boolean;"

begin
there_is_a_cold_day_in_hell := 0;
should be: "there_is_a_cold_day_in_hell := false;"
(alternative - modify the 'until' statement - less clear)
repeat
writeln('Wotsit Wirth');
until there_is_a_cold_day_in_hell;
end.

<g,d&rf>


and it should now pass the compiler. <running>

--
Chuck F (cb********@yahoo.com) (cb********@worldnet.att.net)
Available for consulting/temporary embedded and systems.
<http://cbfalconer.home.att.net> USE worldnet address!
Nov 14 '05 #15

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

24
by: Andy Sutorius | last post by:
Has anyone successfully created a Hello World program without using Visual Studio.NET? If so, what IDE did you use and what namespaces did you import? Thanks! Andy Sutorius
2
by: ME | last post by:
I am trying to find a prewritten method for converting a string like this:"Hello World" to this "Hello\sWorld". I plan to use it to build a regular expression. Specifically I am looking for a...
17
by: Tim Judd | last post by:
I must not be grasping anything here. Just a simple application, as follows (as any first-program is...) ---- #include <iostream.h> int main() { cout <<"hello world"; return 0;
6
by: RC | last post by:
Hello World, I am try do call a JavaScript function from XSLT, but I got function not avaible error. See "????" below. Would someone out there tell me how? Thank Q! <xsl:stylesheet...
8
by: vijay | last post by:
Hello, As the subject suggests, I need to print the string in the reverse order. I made the following program: # include<stdio.h> struct llnode { char *info;
4
by: arnuld | last post by:
i am learning C and doing the exercise 1-1 of K&R2, where K&R ask to remove some parts of programme and experiment with error, so here i go: #include <stdio.h> int main () { printf('hello...
0
by: C.W.Holeman II | last post by:
As K&R state the hardest part is getting a first instance to work. So I am looking for a "hello, world!" example for adding an additional element to an XHTML file. <html> <head><title>Hello,...
1
by: James T. Dennis | last post by:
You'd think that using things like gettext would be easy. Superficially it seems well documented in the Library Reference(*). However, it can be surprisingly difficult to get the external details...
11
by: cj | last post by:
Perhaps someone knows how to do this. When I open a new ASP.NET web service application in VS 2008, it opens with a simple Hello World web service already written. I want to see this work. ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.