This is an archive of a previous version of Sodarace.

Please visit http://sodarace.net for the latest version.

forum  |  »» sodaplay
 
»» forums  »» community discussion forum

subject: Do you want to learn to program in C

357 replies on 24 pages. most recent reply: Tues, Aug 28 10:58 PM by matthew102000

»» back to topic list  

This topic has 357 replies on 24 pages [ « | 1 ... 21 22 23 24 ]
»» previous topic   »» next topic  


edlinfan

»» models
»» homepage

Re: Do you want to learn to program in C   posted: 22-Jul-07 05:12   »» 
This was a very active topic once and I would hate to see it die.

matthew102000

»» models

Re: Do you want to learn to program in C   posted: 22-Jul-07 19:23   »» 
me too. cactus iv been thinking, mabey do this formula...

((0-(picknum/2)+correct)/bet)

well dont use that but mabey something along the lines of the 0 part that i have in there.

matt wuz here

cactus2

»» models

Re: Do you want to learn to program in C   posted: 23-Jul-07 13:03   »» 
Yeah, that could work, but shouldn't it be multplied by the bet?

((0-(picknum/2)+correct)/bet) =(correct-(picknum/2))/bet

matthew102000

»» models

Re: Do you want to learn to program in C   posted: 11-Aug-07 23:50   »» 
hey uhh. this may sound kind of embarrassing, but, i was in yosemitie for a week. i met this girl and lost her e-mail when she gave it to me. i dont heve her phone # but i do remember part of her e-mail and made a program so i can find it. problem is, it needs to have three numbers instead of one in it. it starts from zero and goes to 999.

i need

000-999

instead of

0-999

so can someone please help me with this? thanks.\

#include <stdio.h>
#include <math.h>
#include <stdlib.h>
int main (void)
{
int zoe, number, number2;
{
printf("input 1\n\n");
scanf("%i", &number);
printf("input 999\n\n");
scanf("%i", &zoe);
printf("input 0\n\n");
scanf("%i", &number2);
{
while (zoe >= number2)
{
printf("zoegirl");
printf("%i", number2);
printf("@hotmail.com; ");
number2++;
}
}
}
system("pause");
return 0;
}

it would be great if someone could help me.

matt wuz here

cactus2

»» models

Re: Do you want to learn to program in C   posted: 12-Aug-07 00:19   »» 
I'm somewhat wondering how this'll help, but here's the modified code.
#include <stdio.h>
#include <math.h>
#include <stdlib.h>
int main (void)
{
int zoe, number, number2;
printf("input 1\n\n");
scanf("%i", &number);
printf("input 999\n\n");
scanf("%i", &zoe);
printf("input 0\n\n");
scanf("%i", &number2);
while (zoe >= number2)
{
//Need new variables, a 3 character string and and an integer.
char string[4];
imt buffer;
printf("zoegirl");
//Modified code starts here
buffer=number2/100;
switch(buffer)
{
case 0:
string[0]='0';
break;
case 1:
string[0]='1';
break;
case 2:
string[0]='2';
break;
case 3:
string[0]='3';
break;
case 4:
string[0]='4';
break;
case 5:
string[0]='5';
break;
case 6:
string[0]='6';
break;
case 7:
string[0]='7';
break;
case 8:
string[0]='8';
break;
case 9:
string[0]='9';
break;
case default:
string[0]='?';
break;
}
buffer=(number2%100)/10;
switch(buffer)
{
case 0:
string[1]='0';
break;
case 1:
string[1]='1';
break;
case 2:
string[1]='2';
break;
case 3:
string[1]='3';
break;
case 4:
string[1]='4';
break;
case 5:
string[1]='5';
break;
case 6:
string[1]='6';
break;
case 7:
string[1]='7';
break;
case 8:
string[1]='8';
break;
case 9:
string[1]='9';
break;
case default:
string[1]='?';
break;
}
buffer=(number2%10);
switch(buffer)
{
case 0:
string[2]='0';
break;
case 1:
string[2]='1';
break;
case 2:
string[2]='2';
break;
case 3:
string[2]='3';
break;
case 4:
string[2]='4';
break;
case 5:
string[2]='5';
break;
case 6:
string[2]='6';
break;
case 7:
string[2]='7';
break;
case 8:
string[2]='8';
break;
case 9:
string[2]='9';
break;
case default:
string[2]='?';
break;
}
string[3]=0x00; //String terminator.
printf("%s", string);
//And ends here
printf("@hotmail.com; ");
number2++;
}
system("pause");
return 0;
}

matthew102000

»» models

Re: Do you want to learn to program in C   posted: 12-Aug-07 01:07   »» 
well i will get alll those e-mails, and send one little message to her saying "if you get this message and its you please resplond" or something like that. ill get back a hole lot of mail delivery system messages saying invalid e-mail, but there will probably there will be a few missing, meaning that they sent and then i can sit back and wait for a reply.

its a little excentric and over-complicated for just finding someones e-mail, but it will have to do.

there are a hle lot of errors in your code like where it sais, case defauly. thos dont want to seem to work. and also, can you have it write it into a file to make it easier to copy and paste. that would work.

thanks for helping me cactus.

matt wuz here

cactus2

»» models

Re: Do you want to learn to program in C   posted: 12-Aug-07 12:58   »» 
#include <stdio.h>
#include <math.h>
#include <stdlib.h>
int main (void)
{
int zoe, number, number2;
printf("input 1\n\n");
scanf("%i", &number);
printf("input 999\n\n");
scanf("%i", &zoe);
printf("input 0\n\n");
scanf("%i", &number2);
while (zoe >= number2)
{
//Need new variables, a 3 character string and and an integer.
char string[4];
imt buffer;
printf("zoegirl");
//Modified code starts here
buffer=number2/100;
switch(buffer)
{
case 0:
string[0]='0';
break;
case 1:
string[0]='1';
break;
case 2:
string[0]='2';
break;
case 3:
string[0]='3';
break;
case 4:
string[0]='4';
break;
case 5:
string[0]='5';
break;
case 6:
string[0]='6';
break;
case 7:
string[0]='7';
break;
case 8:
string[0]='8';
break;
case 9:
string[0]='9';
break;
default:
string[0]='?';
break;
}
buffer=(number2%100)/10;
switch(buffer)
{
case 0:
string[1]='0';
break;
case 1:
string[1]='1';
break;
case 2:
string[1]='2';
break;
case 3:
string[1]='3';
break;
case 4:
string[1]='4';
break;
case 5:
string[1]='5';
break;
case 6:
string[1]='6';
break;
case 7:
string[1]='7';
break;
case 8:
string[1]='8';
break;
case 9:
string[1]='9';
break;
default:
string[1]='?';
break;
}
buffer=(number2%10);
switch(buffer)
{
case 0:
string[2]='0';
break;
case 1:
string[2]='1';
break;
case 2:
string[2]='2';
break;
case 3:
string[2]='3';
break;
case 4:
string[2]='4';
break;
case 5:
string[2]='5';
break;
case 6:
string[2]='6';
break;
case 7:
string[2]='7';
break;
case 8:
string[2]='8';
break;
case 9:
string[2]='9';
break;
default:
string[2]='?';
break;
}
string[3]=0x00; //String terminator.
printf("%s", string);
//And ends here
printf("@hotmail.com; ");
number2++;
}
system("pause");
return 0;
}

So what are the rest of the errors?

matthew102000

»» models

Re: Do you want to learn to program in C   posted: 12-Aug-07 16:35   »» 
well for one thing it starts out on 100 instead of 000. i have an idea to modify mine but can you fix yours. thanks.

my idea is to do

}
if (number2 < 10)
{
number2 * 10
}
if (number2 > 10 || number < 100)
{
number2 * 100

or something like that.

matt wuz here

matthew102000

»» models

Re: Do you want to learn to program in C   posted: 12-Aug-07 16:48   »» 
heres what i did to mine. i added the file writing part of it but it doesent want the fprintf things to work. can you fix them???

#include <stdio.h>
#include <math.h>
#include <stdlib.h>
int main (void)
{
int zoe, number, number2;
char name[20];
FILE *fp;
{
printf("What is the name of the file to be created?");
scanf("%s", name);
printf("input 1\n\n");
scanf("%i", &number);
printf("input 999\n\n");
scanf("%i", &zoe);
printf("input 0\n\n");
scanf("%i", &number2);
{
while (zoe >= number2)
{
fp = fopen( name, "w");
fprintf("zoegirl");
fprintf("%i", number2);
fprintf("@hotmail.com; ");
number2++;
fclose(fp);
}
if (number2 < 10)
{
number2 * 10;
}
if (number2 > 10 || number < 100)
{
number2 * 100;
}
}
}
system("pause");
return 0;
}

matt wuz here

cactus2

»» models

Re: Do you want to learn to program in C   posted: 12-Aug-07 19:07   »» 
#include <stdio.h>
#include <math.h>
#include <stdlib.h>
int main (void)
{
int zoe, number, number2;
char name[20];
FILE *fp;
{
printf("What is the name of the file to be created?");
scanf("%s", name);
printf("input 1\n\n");
scanf("%i", &number);
printf("input 999\n\n");
scanf("%i", &zoe);
printf("input 0\n\n");
scanf("%i", &number2);

while (zoe >= number2)
{
fp = fopen( name, "w");
fprintf(fp, "zoegirl");
if(number2<100) fprintf(fp, "0");
if(number2<10) fprintf(fp,"0");
fprintf(fp, "%i", number2);
fprintf(fp, "@hotmail.com;\n ");
number2++;
fclose(fp);
}

system("pause");
return 0;
}

cactus2

»» models

Re: Do you want to learn to program in C   posted: 12-Aug-07 19:11   »» 
STDP. Left an extra parenthesis and forgot to fix another thing.
#include <stdio.h>
#include <math.h>
#include <stdlib.h>
int main (void)
{
int zoe, number, number2;
char name[20];
FILE *fp;

printf("What is the name of the file to be created?");
scanf("%s", name);
printf("input 1\n\n");
scanf("%i", &number);
printf("input 999\n\n");
scanf("%i", &zoe);
printf("input 0\n\n");
scanf("%i", &number2);

if((fp = fopen( name, "w"))==NULL)
{
printf("The file would not open/n");
system("pause");
return 0;
}
while (zoe >= number2)
{
fprintf(fp, "zoegirl");
if(number2<100) fprintf(fp, "0");
if(number2<10) fprintf(fp,"0");
fprintf(fp, "%i", number2);
fprintf(fp, "@hotmail.com;\n ");
number2++;
}
fclose(fp);

system("pause");
return 0;
}

matthew102000

»» models

Re: Do you want to learn to program in C   posted: 12-Aug-07 21:59   »» 
thanks cactus! i tweaked it a little so that it wouldnt go to the next line every time it said a new e-mail.

i sent all 1000 of them (phew!!!) and got 999 mail delivery systems back. that means one sent. youve been a big help. i couldnt have figured the file thing out without you.

anyway ill be busy deleting e-mails for about an hour so see ya!

mayy wuz here

matthew102000

»» models

Re: Do you want to learn to program in C   posted: 28-Aug-07 22:58   »» 
i have an idea for an add on to super calculator. my idea is for a fraction reducer. input the numerator and denominator, and it uses math to output it in its simplest form. the only problem is i dont know how i can do that. please help.

matt wuz here



This topic has 357 replies on 24 pages [ « | 1 ... 21 22 23 24 ]


»» previous topic   »» next topic  

»» back to topic list  »» top of the page  

PLEASE READ THE FORUM GUIDELINES AND ALWAYS PREVIEW TO CHECK MESSAGES BEFORE POSTING...
...Help keep our forums creative and constructive. Thank you.


»» forum home