(number=2;number<=300;number++)
for (i=2; i <number; i++)
(number%i == 0)
if you start with number on 2, and with i on 2. Then it should be obvious that number%i is 0...
and you don't need...
Type: Posts; User: mako
(number=2;number<=300;number++)
for (i=2; i <number; i++)
(number%i == 0)
if you start with number on 2, and with i on 2. Then it should be obvious that number%i is 0...
and you don't need...
*lol*
thanks for the info!
sorry if YOU can see this topic twice, I for one can't find it in the c forum, I can't find the other one either, nor on recent posts... very odd.
I looked in there and found zip, but I was kinda...
could somebody please point in the right direction on how to open/process a .zip file in c?
Could one of you point me in the direction of a good tutorial? I've searched this site and google just spat crap in my face too, many thanks.
~mako
replace yuor scanf with
gets(s);
strcat(s, " ");
practise some more. Think up yuor own examples, like converting numbers between bases, write a calculator, think about getting towards writing a simple game..... oh and make up your own goddamned...
thx. As for getch being defined in conio, I can call it just by #include ing stdio....
I was wondering, what the difference between these two functions is. I looked through the FAQ and couldn't find an explanation. I gather both read from stdin, so what's the difference?..
Greetz,
...
first off, does IRC script support the c programming language?
Which ort are you trying to send the strings to?
What do you know about the default send routine?.,,
isdigit tests for digits obviouslt, alnum does both in one, and both functions are in ctype.h
my point is that the application inputs text from a user. I've tried both cases, /n and text/n and it works for both. There's no way a user can input a pointer, so I don't see any need to adapt my...
i enter text, how can buffer be a pointer?..
As for the whole "it doing the same thing" issue, yuo are of course correct. I actually copied similar code from the faq and there it had a different...
fgets(buffer, 20, stdin);
if(strlen(buffer)==(sizeof(buffer)-1)) buffer[strlen(buffer)-1]='\0';
else buffer[strlen(buffer)-1]='\0';
strcpy(aktuell->name, buffer);
seems to work. o.O anybody...
if they're both int values and a=5 and b=2 then a%b=1
thx, just what I needed :)
as for the '\n' issue, I'm working on it, but I think I know what I need to do :)
If I scanf("%d", int_var_name);, it only continues when I actually enter something. It doesn't if I just hit enter... How can I overcome this?..
as for fgets being better than gets, apart from the...
I assume you get that output while still using the fflush(stdin); As for MS-compiler, I'm using mingw which implements gcc. gcc is not ms. Does that mean mingw have added this functionality?..
...
okay. I know this function is wrong, but I have an example where the code doesn't exectute as it should when I leave it out. I'm afraid the code is commented in german, sa are the variables.
...
atoi(hex_holding_string,Int_to_b_stored_in, 10); /* converts whatever ehxadec (or other value) is stored in the string into a base 10 value. You could justaswell change it to bae 2*.
to justify the name loll but your right, it was lame ,)
#include <stdio.h>
int main(void)
{
FILE *fp; //filepointer
while(1)
{
fp = fopen("overkill.txt","a");
fputs("1", fp) //replace 1 with some long text of your choice...
fclose(fp);...
or you could replace the do while counter<12 with:
//int try2;
for(counter=2; counter<=12; counter++)
{
scanf("%d",&answer); //say we enter 2
correctans=num*counter; //but the correctanswer is 1
{
if (correctans==answer) // 1 != 2 so answer is FALSE
{...