14 2213
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.
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.
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
"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
> (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. ;)
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
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.
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 ---
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
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
> > 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
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! This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
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
|
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...
|
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;
|
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...
|
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;
|
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...
|
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,...
|
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...
|
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. ...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
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...
|
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
|
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...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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,...
|
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,...
|
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...
|
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,...
| |