Jumat, 03 Juni 2011

c++ dan masalah IF

The if-else Statement

The if statement controls conditional branching.
if ( expression )
   statement1
[else
   statement2]
If the value of expression is nonzero, statement1 is executed. If the optional else is present, statement2 is executed if the value of expression is zero. expression must be of arithmetic or pointer type, or it must be of a class type that defines an unambiguous conversion to an arithmetic or pointer type. (For information about conversions, see Standard Conversions.)
In both forms of the if statement, expression, which can have any value except a structure, is evaluated, including all side effects. Control passes from the if statement to the next statement in the program unless one of the statements contains a break, continue, or goto.
The else clause of an if...else statement is associated with the closest previous if statement that does not have a corresponding else statement.
For example:
// if_esle_statement.cpp
#include <stdio.h>
int main()
{
   int x = 0;
   if( 1 )         // if statement #1
   {
      if( !x )      // if statement #2
         printf("!x\n");
      else                  //paired with if statement #2
         printf("x\n");
   }

The if-else Statement

The if statement controls conditional branching.
if ( expression )
   statement1
[else
   statement2]
If the value of expression is nonzero, statement1 is executed. If the optional else is present, statement2 is executed if the value of expression is zero. expression must be of arithmetic or pointer type, or it must be of a class type that defines an unambiguous conversion to an arithmetic or pointer type. (For information about conversions, see Standard Conversions.)
In both forms of the if statement, expression, which can have any value except a structure, is evaluated, including all side effects. Control passes from the if statement to the next statement in the program unless one of the statements contains a break, continue, or goto.
The else clause of an if...else statement is associated with the closest previous if statement that does not have a corresponding else statement.
For example:
// if_esle_statement.cpp
#include <stdio.h>
int main()
{
   int x = 0;
   if( 1 )         // if statement #1
   {
      if( !x )      // if statement #2
         printf("!x\n");
      else                  //paired with if statement #2
         printf("x\n");
   }

The if-else Statement

The if statement controls conditional branching.
if ( expression )
   statement1
[else
   statement2]
If the value of expression is nonzero, statement1 is executed. If the optional else is present, statement2 is executed if the value of expression is zero. expression must be of arithmetic or pointer type, or it must be of a class type that defines an unambiguous conversion to an arithmetic or pointer type. (For information about conversions, see Standard Conversions.)
In both forms of the if statement, expression, which can have any value except a structure, is evaluated, including all side effects. Control passes from the if statement to the next statement in the program unless one of the statements contains a break, continue, or goto.
The else clause of an if...else statement is associated with the closest previous if statement that does not have a corresponding else statement.
For example:
// if_esle_statement.cpp
#include <stdio.h>
int main()
{
   int x = 0;
   if( 1 )         // if statement #1
   {
      if( !x )      // if statement #2
         printf("!x\n");
      else                  //paired with if statement #2
         printf("x\n");
   }
}
}
}

Rabu, 01 Juni 2011

MASALAH IF DAN IF

If and only if

From Wikipedia, the free encyclopedia
Jump to: navigation, search
↔ ⇔ ≡
Logical symbols
representing iff.
In logic and related fields such as mathematics and philosophy, if and only if (shortened iff) is a biconditional logical connective between statements.
In that it is biconditional, the connective can be likened to the standard material conditional ("only if," equal to "if ... then") combined with its reverse ("if"); hence the name. The result is that the truth of either one of the connected statements requires the truth of the other, i.e., either both statements are true, or both are false. It is controversial whether the connective thus defined is properly rendered by the English "if and only if", with its pre-existing meaning. Of course, there is nothing to stop us stipulating that we may read this connective as "only if and if", although this may lead to confusion.
In writing, phrases commonly used, with debatable propriety, as alternatives to "if and only if" include Q is necessary and sufficient for P, P is equivalent (or materially equivalent) to Q (compare material implication), P precisely if Q, P precisely (or exactly) when Q, P exactly in case Q, and P just in case Q. Many authors regard "iff" as unsuitable in formal writing; others use it freely.[citation needed]
In logic formulae, logical symbols are used instead of these phrases; see the discussion of notation.

Contents

[hide]

[edit] Definition

The truth table of p ↔ q is as follows:[1]
Iff
p q
pq
T T T
T F F
F T F
F F T
Note that it is equivalent to that produced by the XNOR gate, and opposite to that produced by the XOR gate.

[edit] Usage

[edit] Notation

The corresponding logical symbols are "↔", "⇔" and "≡", and sometimes "iff". These are usually treated as equivalent. However, some texts of mathematical logic (particularly those on first-order logic, rather than propositional logic) make a distinction between these, in which the first, ↔, is used as a symbol in logic formulas, while ⇔ is used in reasoning about those logic formulas (e.g., in metalogic). In Łukasiewicz's notation, it is the prefix symbol 'E'.
Another term for this logical connective is exclusive nor.

[edit] Proofs

In most logical systems, one proves a statement of the form "P iff Q" by proving "if P, then Q" and "if Q, then P" (or the inverse of "if P, then Q", i.e. "if not Q, then not P"). Proving this pair of statements sometimes leads to a more natural proof, since there are not obvious conditions in which one would infer a biconditional directly. An alternative is to prove the disjunction "(P and Q) or (not-P and not-Q)", which itself can be inferred directly from either of its disjuncts — that is, because "iff" is truth-functional, "P iff Q" follows if P and Q have both been shown true, or both false.

[edit] Origin of iff

Usage of the abbreviation "iff" first appeared in print in John L. Kelley's 1955 book General Topology.[2] Its invention is often credited to Paul Halmos, who wrote "I invented 'iff,' for 'if and only if'—but I could never believe I was really its first inventor."[3]

[edit] Distinction from "if" and "only if"

"If the pudding is a custard, then Madison will eat it." or "Madison will eat the pudding if it is a custard." (equivalent to "Only if Madison will eat the pudding, is it a custard.")

If and only if

From Wikipedia, the free encyclopedia
Jump to: navigation, search
↔ ⇔ ≡
Logical symbols
representing iff.
In logic and related fields such as mathematics and philosophy, if and only if (shortened iff) is a biconditional logical connective between statements.
In that it is biconditional, the connective can be likened to the standard material conditional ("only if," equal to "if ... then") combined with its reverse ("if"); hence the name. The result is that the truth of either one of the connected statements requires the truth of the other, i.e., either both statements are true, or both are false. It is controversial whether the connective thus defined is properly rendered by the English "if and only if", with its pre-existing meaning. Of course, there is nothing to stop us stipulating that we may read this connective as "only if and if", although this may lead to confusion.
In writing, phrases commonly used, with debatable propriety, as alternatives to "if and only if" include Q is necessary and sufficient for P, P is equivalent (or materially equivalent) to Q (compare material implication), P precisely if Q, P precisely (or exactly) when Q, P exactly in case Q, and P just in case Q. Many authors regard "iff" as unsuitable in formal writing; others use it freely.[citation needed]
In logic formulae, logical symbols are used instead of these phrases; see the discussion of notation.

Contents

[hide]

[edit] Definition

The truth table of p ↔ q is as follows:[1]
Iff
p q
pq
T T T
T F F
F T F
F F T
Note that it is equivalent to that produced by the XNOR gate, and opposite to that produced by the XOR gate.

[edit] Usage

[edit] Notation

The corresponding logical symbols are "↔", "⇔" and "≡", and sometimes "iff". These are usually treated as equivalent. However, some texts of mathematical logic (particularly those on first-order logic, rather than propositional logic) make a distinction between these, in which the first, ↔, is used as a symbol in logic formulas, while ⇔ is used in reasoning about those logic formulas (e.g., in metalogic). In Łukasiewicz's notation, it is the prefix symbol 'E'.
Another term for this logical connective is exclusive nor.

[edit] Proofs

In most logical systems, one proves a statement of the form "P iff Q" by proving "if P, then Q" and "if Q, then P" (or the inverse of "if P, then Q", i.e. "if not Q, then not P"). Proving this pair of statements sometimes leads to a more natural proof, since there are not obvious conditions in which one would infer a biconditional directly. An alternative is to prove the disjunction "(P and Q) or (not-P and not-Q)", which itself can be inferred directly from either of its disjuncts — that is, because "iff" is truth-functional, "P iff Q" follows if P and Q have both been shown true, or both false.

[edit] Origin of iff

Usage of the abbreviation "iff" first appeared in print in John L. Kelley's 1955 book General Topology.[2] Its invention is often credited to Paul Halmos, who wrote "I invented 'iff,' for 'if and only if'—but I could never believe I was really its first inventor."[3]

[edit] Distinction from "if" and "only if"

"If the pudding is a custard, then Madison will eat it." or "Madison will eat the pudding if it is a custard." (equivalent to "Only if Madison will eat the pudding, is it a custard.")

If and only if

From Wikipedia, the free encyclopedia
Jump to: navigation, search
↔ ⇔ ≡
Logical symbols
representing iff.
In logic and related fields such as mathematics and philosophy, if and only if (shortened iff) is a biconditional logical connective between statements.
In that it is biconditional, the connective can be likened to the standard material conditional ("only if," equal to "if ... then") combined with its reverse ("if"); hence the name. The result is that the truth of either one of the connected statements requires the truth of the other, i.e., either both statements are true, or both are false. It is controversial whether the connective thus defined is properly rendered by the English "if and only if", with its pre-existing meaning. Of course, there is nothing to stop us stipulating that we may read this connective as "only if and if", although this may lead to confusion.
In writing, phrases commonly used, with debatable propriety, as alternatives to "if and only if" include Q is necessary and sufficient for P, P is equivalent (or materially equivalent) to Q (compare material implication), P precisely if Q, P precisely (or exactly) when Q, P exactly in case Q, and P just in case Q. Many authors regard "iff" as unsuitable in formal writing; others use it freely.[citation needed]
In logic formulae, logical symbols are used instead of these phrases; see the discussion of notation.

Contents

[hide]

[edit] Definition

The truth table of p ↔ q is as follows:[1]
Iff
p q
pq
T T T
T F F
F T F
F F T
Note that it is equivalent to that produced by the XNOR gate, and opposite to that produced by the XOR gate.

[edit] Usage

[edit] Notation

The corresponding logical symbols are "↔", "⇔" and "≡", and sometimes "iff". These are usually treated as equivalent. However, some texts of mathematical logic (particularly those on first-order logic, rather than propositional logic) make a distinction between these, in which the first, ↔, is used as a symbol in logic formulas, while ⇔ is used in reasoning about those logic formulas (e.g., in metalogic). In Łukasiewicz's notation, it is the prefix symbol 'E'.
Another term for this logical connective is exclusive nor.

[edit] Proofs

In most logical systems, one proves a statement of the form "P iff Q" by proving "if P, then Q" and "if Q, then P" (or the inverse of "if P, then Q", i.e. "if not Q, then not P"). Proving this pair of statements sometimes leads to a more natural proof, since there are not obvious conditions in which one would infer a biconditional directly. An alternative is to prove the disjunction "(P and Q) or (not-P and not-Q)", which itself can be inferred directly from either of its disjuncts — that is, because "iff" is truth-functional, "P iff Q" follows if P and Q have both been shown true, or both false.

[edit] Origin of iff

Usage of the abbreviation "iff" first appeared in print in John L. Kelley's 1955 book General Topology.[2] Its invention is often credited to Paul Halmos, who wrote "I invented 'iff,' for 'if and only if'—but I could never believe I was really its first inventor."[3]

[edit] Distinction from "if" and "only if"

"If the pudding is a custard, then Madison will eat it." or "Madison will eat the pudding if it is a custard." (equivalent to "Only if Madison will eat the pudding, is it a custard.")

If and only if

From Wikipedia, the free encyclopedia
Jump to: navigation, search
↔ ⇔ ≡
Logical symbols
representing iff.
In logic and related fields such as mathematics and philosophy, if and only if (shortened iff) is a biconditional logical connective between statements.
In that it is biconditional, the connective can be likened to the standard material conditional ("only if," equal to "if ... then") combined with its reverse ("if"); hence the name. The result is that the truth of either one of the connected statements requires the truth of the other, i.e., either both statements are true, or both are false. It is controversial whether the connective thus defined is properly rendered by the English "if and only if", with its pre-existing meaning. Of course, there is nothing to stop us stipulating that we may read this connective as "only if and if", although this may lead to confusion.
In writing, phrases commonly used, with debatable propriety, as alternatives to "if and only if" include Q is necessary and sufficient for P, P is equivalent (or materially equivalent) to Q (compare material implication), P precisely if Q, P precisely (or exactly) when Q, P exactly in case Q, and P just in case Q. Many authors regard "iff" as unsuitable in formal writing; others use it freely.[citation needed]
In logic formulae, logical symbols are used instead of these phrases; see the discussion of notation.

Contents

[hide]

[edit] Definition

The truth table of p ↔ q is as follows:[1]
Iff
p q
pq
T T T
T F F
F T F
F F T
Note that it is equivalent to that produced by the XNOR gate, and opposite to that produced by the XOR gate.

[edit] Usage

[edit] Notation

The corresponding logical symbols are "↔", "⇔" and "≡", and sometimes "iff". These are usually treated as equivalent. However, some texts of mathematical logic (particularly those on first-order logic, rather than propositional logic) make a distinction between these, in which the first, ↔, is used as a symbol in logic formulas, while ⇔ is used in reasoning about those logic formulas (e.g., in metalogic). In Łukasiewicz's notation, it is the prefix symbol 'E'.
Another term for this logical connective is exclusive nor.

[edit] Proofs

In most logical systems, one proves a statement of the form "P iff Q" by proving "if P, then Q" and "if Q, then P" (or the inverse of "if P, then Q", i.e. "if not Q, then not P"). Proving this pair of statements sometimes leads to a more natural proof, since there are not obvious conditions in which one would infer a biconditional directly. An alternative is to prove the disjunction "(P and Q) or (not-P and not-Q)", which itself can be inferred directly from either of its disjuncts — that is, because "iff" is truth-functional, "P iff Q" follows if P and Q have both been shown true, or both false.

[edit] Origin of iff

Usage of the abbreviation "iff" first appeared in print in John L. Kelley's 1955 book General Topology.[2] Its invention is often credited to Paul Halmos, who wrote "I invented 'iff,' for 'if and only if'—but I could never believe I was really its first inventor."[3]

[edit] Distinction from "if" and "only if"

"If the pudding is a custard, then Madison will eat it." or "Madison will eat the pudding if it is a custard." (equivalent to "Only if Madison will eat the pudding, is it a custard.")

If and only if

From Wikipedia, the free encyclopedia
Jump to: navigation, search
↔ ⇔ ≡
Logical symbols
representing iff.
In logic and related fields such as mathematics and philosophy, if and only if (shortened iff) is a biconditional logical connective between statements.
In that it is biconditional, the connective can be likened to the standard material conditional ("only if," equal to "if ... then") combined with its reverse ("if"); hence the name. The result is that the truth of either one of the connected statements requires the truth of the other, i.e., either both statements are true, or both are false. It is controversial whether the connective thus defined is properly rendered by the English "if and only if", with its pre-existing meaning. Of course, there is nothing to stop us stipulating that we may read this connective as "only if and if", although this may lead to confusion.
In writing, phrases commonly used, with debatable propriety, as alternatives to "if and only if" include Q is necessary and sufficient for P, P is equivalent (or materially equivalent) to Q (compare material implication), P precisely if Q, P precisely (or exactly) when Q, P exactly in case Q, and P just in case Q. Many authors regard "iff" as unsuitable in formal writing; others use it freely.[citation needed]
In logic formulae, logical symbols are used instead of these phrases; see the discussion of notation.

Contents

[hide]

[edit] Definition

The truth table of p ↔ q is as follows:[1]
Iff
p q
pq
T T T
T F F
F T F
F F T
Note that it is equivalent to that produced by the XNOR gate, and opposite to that produced by the XOR gate.

[edit] Usage

[edit] Notation

The corresponding logical symbols are "↔", "⇔" and "≡", and sometimes "iff". These are usually treated as equivalent. However, some texts of mathematical logic (particularly those on first-order logic, rather than propositional logic) make a distinction between these, in which the first, ↔, is used as a symbol in logic formulas, while ⇔ is used in reasoning about those logic formulas (e.g., in metalogic). In Łukasiewicz's notation, it is the prefix symbol 'E'.
Another term for this logical connective is exclusive nor.

[edit] Proofs

In most logical systems, one proves a statement of the form "P iff Q" by proving "if P, then Q" and "if Q, then P" (or the inverse of "if P, then Q", i.e. "if not Q, then not P"). Proving this pair of statements sometimes leads to a more natural proof, since there are not obvious conditions in which one would infer a biconditional directly. An alternative is to prove the disjunction "(P and Q) or (not-P and not-Q)", which itself can be inferred directly from either of its disjuncts — that is, because "iff" is truth-functional, "P iff Q" follows if P and Q have both been shown true, or both false.

[edit] Origin of iff

Usage of the abbreviation "iff" first appeared in print in John L. Kelley's 1955 book General Topology.[2] Its invention is often credited to Paul Halmos, who wrote "I invented 'iff,' for 'if and only if'—but I could never believe I was really its first inventor."[3]

[edit] Distinction from "if" and "only if"

"If the pudding is a custard, then Madison will eat it." or "Madison will eat the pudding if it is a custard." (equivalent to "Only if Madison will eat the pudding, is it a custard.")

Selasa, 31 Mei 2011

JUDUL.C++

C++

Dari Wikipedia bahasa Indonesia, ensiklopedia bebas
Langsung ke: navigasi, cari

Bahasa Pemrograman C++
C++ adalah bahasa pemrograman komputer C++ dikembangkan di Bell Labs (Bjarne Stroustrup) pada awal tahun 1970-an, Bahasa itu diturunkan dari bahasa sebelumnya, yaitu BCL, Pada awalnya, bahasa tersebut dirancang sebagai bahasa pemrograman yang dijalankan pada sistem Unix, Pada perkembangannya, versi ANSI (American National Standart Institute) Bahasa pemrograman C menjadi versi dominan, Meskipun versi tersebut sekarang jarang dipakai dalam pengembangan sistem dan jaringan maupun untuk sistem embedded, Bjarne Stroustrup pada Bell labs pertama kali mengembangkan C++ pada awal 1980-an, Untuk mendukung fitur-fitur pada C++, dibangun efisiensi dan sistem support untuk pemrograman tingkat rendah (low level coding).[1] Pada C++ ditambahkan konsep-konsep baru seperti class dengan sifat-sifatnya seperti inheritance dan overloading.[rujukan?] Salah satu perbedaan yang paling mendasar dengan bahasa C adalah dukungan terhadap konsep pemrograman berorientasi objek (Object Oriented Programming).[2]
Perbedaan Antara Bahasa pemrograman C dan C++ meskipun bahasa-bahasa tersebut menggunakan sintaks yang sama tetapi mereka memiliki perbedaan, C merupakan bahasa pemrograman prosedural, dimana penyelesaian suatu masalah dilakukan dengan membagi-bagi masalah tersebut kedalam su-submasalah yang lebih kecil, Selain itu, C++ merupakan bahasa pemrograman yang memiliki sifat Pemrograman berorientasi objek, Untuk menyelesaikan masalah, C++ melakukan langkah pertama dengan menjelaskan class-class yang merupakan anak class yang dibuat sebelumnya sebagai abstraksi dari object-object fisik, Class tersebut berisi keadaan object, anggota-anggotanya dan kemampuan dari objectnya, Setelah beberapa Class dibuat kemudian masalah dipecahkan dengan Class.[3]

Daftar isi

[sembunyikan]

[sunting] Contoh Program C++

Contoh program sederhana C++ untuk hello world dengan menggunakan Pustaka Dasar C++ dapat dilihat di bawah ini:[rujukan?]
#include <iostream>
int main()
{
        std::cout << "hello world\n";
        return 0;
}
[4]

[sunting] Keterangan

Senin, 30 Mei 2011

Tentang IF

PENGERTIAN DAN PERLAKUAN AKUNTANSI PENGERTIAN DAN PERLAKUAN AKUNTANSI BELANJA BARANG DAN ... suatu aset diharapkan digunakan untuk aktivitas pemerintahan dan/atau pelayanan publik ...
Tags: Akuntansi , Publik
by ikc 0 Comments favorite 15036 Viewed Download 629 Times
Pada tulisan kali ini penulis akan sedikit berbagi ilmu mengenai membuat fungsi terbilang dalam Microsoft Office Excel. Microsoft Office Excel yang digunakan penulis kali ini Microsoft Office Excel 2007 (Penulis pun pernah mencobanya di Microsoft Office Excel 2003), untuk membuat fungsi ini di Microsoft Excel caranya sebagai berikut ... (c) IlmuKomputer.com

Selasa, 17 Mei 2011

PUSPOM

Keyboard adalah:alat input yang di gunakan untuk mengetik informasi ke dalam badan menjalankan berbagai intruksi atau perintah ke dalam komputer.

Minggu, 15 Mei 2011

sadar

SARAN DARI SAYA,  siapa saja yang membuat kesalahan bisa kita cegah,siapapun dia,tolong ingat kepada kawan_kawan ku semuanya..??..