Results 1 to 9 of 9
Thread: ++
Hybrid View
-
16th November 2010 18:25 #1-==-
Join Date: Sep:2003
Location:
Posts: 6,444
++
. while . .
PHP Code:#include <cstdlib>
#include <iostream>
#include <math.h>
using namespace std;
int main(int argc, char *argv[])
{
double number,igues,err,tmp,prec,;
long int counter,i;
counter=0;
err=1;
prec=1/1000;
cout<<"Number:";
cin>>number;
cout<<"Initial gues:";
cin>>igues;
while ((counter<=10)or(err>=prec))
{
tmp = igues/2 + number/igues/2;
err = fabs((tmp*tmp - number));
igues = tmp;
counter++;
cout<<counter<<" iteration:"<<igues<<" err: "<<err<<"\n";
};
system("PAUSE");
return EXIT_SUCCESS;
}
-
16th November 2010 19:03 #2
-
16th November 2010 19:09 #3
-
16th November 2010 19:12 #4-==-
Join Date: Sep:2003
Location:
Posts: 6,444
-
17th November 2010 00:42 #5
<offtopic>
, or || , ...
</offtopic>Internet - it doesn't make you stupid, it just makes your stupidity more accessible to others
-
17th November 2010 07:14 #6-==-
Join Date: Sep:2003
Location:
Posts: 6,444
-
17th November 2010 10:54 #7
C++ "or" ,
- . 10, - . - &&, andCode:#define or ||
Internet - it doesn't make you stupid, it just makes your stupidity more accessible to others
-
17th November 2010 15:33 #8-==-
Join Date: Sep:2003
Location:
Posts: 6,444
-
17th November 2010 15:53 #9
icaci, , gcc or, and extension - , '|', '&' ( 6
).
kate "or", "and", "xor" , for, if .
- if- && (and) || (or)., . .
"640K ught to be enough for anybody" - Bill Gates, 1981
::Machine specs::Fract::AGG::::Baileys::blog::YouTube channel





Reply With Quote
Lenovo ThinkPad 15 IdeaPad 15
5th May 2023, 22:16 in