Sunday, July 25, 2010

How To Mend A Broken Front Tooth

Serie Fibonacci: Print first 'n' numbers

programming in general, not just C language, use of exercises related to the Fibonacci series is a classic, and in this exercise, the idea is to print the first n numbers series, where n is a predefined value and restrictions of language should not be a very large number.

We will print the first 20 numbers in Dev-C series.

 
# include \u0026lt;iostream>

using namespace std;

int previous1 , anterior2, current, i;

int main (void )

{court \u0026lt;\u0026lt;"This program will print the first 20 numbers in the series of Fibbonacci "\u0026lt;\u0026lt;endl;
system (" pause ");
previous1 = 0;
anterior2 = 1;
court \u0026lt;\u0026lt;previous1 \u0026lt;\u0026lt;endl;
court \u0026lt;\u0026lt;anterior2 \u0026lt;\u0026lt;endl ;
for (i = 1; i \u0026lt;= 20; i + +)
/ * The 20 refers to the amount of numbers to print * /

{+ current = anterior2 previous1, previous1 = anterior2
;
court \u0026lt;\u0026lt;today \u0026lt;\u0026lt;endl;
anterior2 = current;}

system ("pause");
return 0;

}

Also in this case, it is possible to modify the program so that the user enter the value of 'n', and it would be better instead to report the numbers as int, long double it as , embracing a greater number of digits when the numbers start to become very large, and would read:

 
previous1 long double, anterior2, current, i;

long double main (void )

Real Gay Father Son Incest

Print odd and even numbers from 1 to 'n'

This is a simple example of the combined use of cycles ( For in this case) and conditionals.
The first idea is to print all the odd numbers from 1 to n, then the couple, noting that "n" is a predefined value, although it could be a simple modification for the user to enter the number.
we go.

 
\u0026lt;iostream> # include using namespace

std;

int a, b, c, d;

int main (void) {

court \u0026lt;\u0026lt;"Printing of odd numbers from 1 to 999" \u0026lt;\u0026lt;endl \u0026lt;\u0026lt; ; endl;
system ("pause");
for (a = 1, a \u0026lt;= 1000; a + +)
{
b = a% 2;
if (b == 1)
{
court \u0026lt;\u0026lt;a \u0026lt;\u0026lt;endl;}


} system ("pause");
court \u0026lt;\u0026lt;"Print the even numbers from 1 to 1000" \u0026lt;\u0026lt;Endl \u0026lt;\u0026lt;endl;
system ("pause");
for (d = 1, d \u0026lt;= 1000; d + +) {

c = d% 2;
if (c = = 0)

{court \u0026lt;\u0026lt;d \u0026lt;\u0026lt;endl;}


} system ("pause");
return 0;}

Tuesday, May 11, 2010

Stop Leaking Water Bottles For Chinchillas

How to fix the error message: 'Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName "Install Webmin on Ubuntu

Surely they tried to restart your Apache server from the command line they found this annoying error. Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName no problem occurs because Apache does not know which is the local host name (localhost) simply open file: / etc/apache2/httpd.conf then;
$ sudo kate / etc/apache2/httpd.conf

certainly is empty, then add the following line:
ServerName localhost save the file and restart the Apache2 server $ sudo / etc/init.d/apache2 restart ready ... Salu2