programming
Casual
171

Contoh C++ Passed Value






  21-Jun-2020 02:41:09



Berikut adalah contoh program passed value c++.Program ini saya susun atas dasar logika saya,jika ada kesalahan mohon dikoreksi ya sob.

Studi kasus :


#include <iostream>

using namespace std;

int p(int x,int y)
{
  return x * y;
}

int main ()
{
  int x = 10;   //syarat :
  int y = 20;   //nilai "x" menjadi 20
  int z = 5;   //nilai "y" menjadi 5
  int temp;   //nilai "z" menjadi 10

  cout <<"parse value\n";
  cout <<"Nilai X = "<<"[" << x  << "]" <<"\n";
  cout <<"Nilai Y = "<<"[" << y  << "]" <<"\n";
  cout <<"Nilai Z = "<<"[" << z  << "]" <<"\n";

  temp = x;
  x = y;
  y = z;
  z = temp;

  cout <<"Pertukaran nilai\n";
  cout <<"Nilai X = "<<"[" << x  << "]" <<"\n";
  cout <<"Nilai Y = "<<"[" << y  << "]" <<"\n";
  cout <<"Nilai Z = "<<"[" << z  << "]" <<"\n";

  cout <<"Hasil perkalian X dan Y =" << p(20,5) <<"\n";
  cout <<"Hasil perkalian Y dan Y =" << p(5,5)  <<"\n";
  cout <<"Hasil perkalian Z dan y =" << p(10,5);
}

output dari program tersebut





Happy learning,Keep spirit and Have fun


DISCUSSION
Member Seccodeid ramayana - 1905
 NONE
22-Jun-2020 05:18:24

tutorial c episode selanjutnya mna

Reply


23-Jun-2020 15:14:06



Nanti ya,saya lagi banyak tugas hehehe

Reply

Member Seccodeid yulian ajam - 2012
 NONE
25-Jun-2020 16:27:44

suwun bos, jawaban anda sangat membantu dalam mengerjakan soal yang begitu rumit ini, tetap semangat tod!


Reply


25-Jun-2020 16:52:35



Okok,terimakasih 🔥

Reply

Member Seccodeid Langlang Gunawa - 2016
 NONE
26-Jun-2020 01:28:05

Berkat ini saya bisa ngerjain soal ini,makasih forum.seccodeid🙌🏻🙌🏻

Reply


26-Jun-2020 22:25:05



Kok jadi mirip kaya klinik tong fang bjir

Reply

Login for comment and discussion.
Login Here
POST NEW DISCUSSION
Popular Posts
Gps Tracker Seccodeid Free Too...
Member Seccodeid Bayu aji
General
1145
104
Top

Mass Reverse IP Unlimited
Member Seccodeid ImamSy
Hacking
836
10
Top

Free Proxy List
Member Seccodeid Sandidi
Networking
700
3
Top

Report McAfee Antivirus Hurrri...
Member Seccodeid Indrasp
Windows
639
93
Top

GHunt OSINT Tools - Investiga...
Member Seccodeid Sandidi
Tools Hacking
612
3
Top

Related Post
Subscribe

Subscribe free now for latest posts