Re: [vox] Why C?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [vox] Why C?
On Sat, 2002-02-23 at 22:06, Ryan wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> I'm currently teaching myself perl, IT ROCKS!
Hehe, bet it does :).
Anyway, took me 15 minutes to remember some simple stuff...But have not
touched C programming in 3 or so years, even then wasn't that advanced:
Guess I can share...
#include<stdio.h>
/* Just trying to remember the basics, wish I knew a whole lot more and
in depth. The source code gives the answers hahaha */
int me;
int you;
int take;
/* int i; just for later perhaps */
int main()
{
printf("Simple number game!!!\n");
printf("Type in a number:");
scanf("%d", &me);
printf("the number is %d\n", me);
printf("Now lets take that number and take it away...Enter number: ");
scanf("%d", &you);
take=me-you;
printf("Here is the result: %d\n", take);
printf("Now I am going to try something a little harder.\n");
if (take!=200)
{
printf("Oooops wrong...Choose again, must be between 100 and 200\n");
}
else
{
printf("That is quite correct, the number was 200...:)\n");
}
return 0;
}
Actually find C++ easier, is that normal? :).
Matt
_______________________________________________
vox mailing list
vox@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox
|