Programming
Casual
537

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



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




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




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
Sponsored

Oppss... No sponsors yet

Popular Posts
Complete Basic Course in Kali...
Djie sam soe Djie sam soe
Linux
12449
2
Top

Gps Tracker Seccodeid Free Too...
Djie sam soe Djie sam soe
General
7353
167
Top

Free Proxy List
Sandidi Sandidi
Networking
3162
3
Top

Mass Reverse IP Unlimited
ImamWawe ImamWawe
Tools Hacking
2563
12
Top

Xampp msyql error cant running
Karno si kribo Karno si kribo
Web Development
1766
25
Top

Related Post

Youtube Video

Subscribe