Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

Lets learn C

Name: Anonymous 2010-02-04 17:28

The only way to learn a new programming language is by writing programs in it. The first
program to write is the same for all languages:
 Print the words
 hello, world 
This is a big hurdle; to leap over it you have to be able to create the program text somewhere,
compile  it  successfully,  load  it,  run  it,  and  find out  where  your  output  went. With  these
mechanical details mastered, everything else is comparatively easy. 
In C, the program to print `` hello, world'' is  
 
   #include <stdio.h>
 
   main()
   {
     printf("hello, world\n");
   }
 
Just how to run this program depends on the system you are using. As a specific example, on
the UNIX operating system you must create the program in a file whose name ends in `` .c'',
such as hello.c, then compile it with the command 
 
   cc hello.c
 

Name: Anonymous 2010-02-05 13:06

what compiler should I use? I'm not on *nix or mac

Name: Anonymous 2010-02-05 16:21

visual studio 2005 has a build in compiler and is free

Name: Anonymous 2010-02-06 11:07

Parse Error, expecting `SEP'
'{ float fahr, celsius'
aborting compile
_________________________
main()
{
printf("Temperature table\n");

}

{
float fahr, celsius;
float lower, upper, step;

lower = 0; /* lower limit of temperatuire scale */
upper = 300; /* upper limit */
step = 20; /* step size */

fahr = lower;
while (fahr <= upper) {
celsius = (5.0/9.0) * (fahr-32.0);
printf("%3.0f %6.1f\n", fahr, celsius);
fahr = fahr + step;
}
}

__________


Mistaken semicolon placed before the statements attached to a function.
_______________

Missing close quotes at the end of a string constant.

Both do not seem to apply at first sight.

Name: sgvdfg 2010-02-08 4:05

<a href="http://www.jewel-tiffany.com/Gucci/Gucci.html" target="_blank">gucci silver jewelry</a>
<a href="http://www.jewel-tiffany.com/Gucci/Gucci.html" target="_blank">gucci silver jewellery</a>
<a href="http://www.jewel-tiffany.com/Gucci/gucci-rings.html" target="_blank">gucci Rings uk</a>
<a href="http://www.jewel-tiffany.com/Gucci/gucci-rings.html" target="_blank">Gucci Rings</a>
<a href="http://www.jewel-tiffany.com/Gucci/gucci-rings.html" target="_blank">gucci silver rings</a>
<a href="http://www.jewel-tiffany.com/Gucci/gucci-rings.html" target="_blank">discount gucci rings</a>
<a href="http://www.jewel-tiffany.com/Gucci/Gucci-Bracelets.html" target="_blank">Gucci Bracelets</a>
<a href="http://www.jewel-tiffany.com/Gucci/Gucci-Bracelets.html" target="_blank">discount Gucci Bracelets</a>

Name: Anonymous 2010-02-08 14:07

Put all of that second block in main(), or turn it into a function.

Name: Anonymous 2010-02-08 14:08

Put all of that second block in main(), or turn it into a function.

Name: Anonymous 2010-02-09 2:56

sloppy code

Name: Anonymous 2010-02-09 14:10

>>7
How do I turn it into a function?

Name: Anonymous 2010-02-11 12:23


Don't change these.
Name: Email:
Entire Thread Thread List