Postingan

Program Mencari Persamaan Linier C++

Gambar
#include<iostream> #include<conio.h> using namespace std;  main() {   int x[3],y[3],z[3];   float hz,hy,hx,hslx,hsly;   cout<<"Mencari Persamaan Linier\ndengan bentuk :\n";   cout<<"x1 + y1 = z1\n";   cout<<"x2 + y2 = z2\n";   cout<<"========================\n";   for(int i=1;i<3;i++)   {  cout<<"Masukkan Nilai x"<<i<<" : ";cin>>x[i];  cout<<"Masukkan Nilai y"<<i<<" : ";cin>>y[i];  cout<<"Masukkan Nilai z"<<i<<" : ";cin>>z[i];   }   cout<<"\nSehingga menjadi :\n";   cout<<x[1]<<"x + "<<y[1]<<"y = "<<z[1]<<"\n";   cout<<x[2]<<"x + "<<y[2]<<"y = "<<z[2]<<"\n";   if(x[1] == x[2])   {  int m;  hy= y[1]-y[2];  h

Program Perbandingan C++

Gambar
#include <iostream> using namespace std; int main() {     int a,b,c;     a=20;     b=10;     cout<<"operator perbandingan\n";     cout<<"www.ibmb.ac.id\n\n";     cout<<"a=20\nb=10\n\n";     cout<<"0 artinya salah\n1 artinya benar\n\n";     c=(a==b);     cout<<"a==b hasilnya "<<c<<endl;     c=(a!=b);     cout<<"a!=b hasilnya "<<c<<endl;     c=(a>b);     cout<<"a>b hasilnya "<<c<<endl;     c=(a<b);     cout<<"a<b hasilnya "<<c<<endl;     c=(a>=b);     cout<<"a>=b hasilnya "<<c<<endl;     c=(a<=b);     cout<<"a<=b hasilnya "<<c<<endl;     return 0; } Matur Sembah Nuwun

Program Penjumlahan C++

Gambar
#include <stdio.h> int main() { int A, B;  A = 10; B = 20; printf("%i", (A+B));  return 0; } Matur Sembah Nuwun

Program Kruskal C++

Gambar
#include<iostream> #include<conio.h> using namespace std; int flag = 0, v[7]; struct node_info {     int no; }*q = NULL, *r = NULL; struct node {     node_info *pt;     node *next; }*top = NULL, *p = NULL, *np = NULL; void push(node_info *ptr) {     np = new node;     np->pt = ptr;     np->next = NULL;     if (top == NULL)     {         top = np;     }     else     {         np->next = top;         top = np;     } } node_info *pop() {     if (top == NULL)     {         cout<<"underflow\n";     }     else     {         p = top;         top = top->next;         return(p->pt);         delete(p);     } } int back_edges(int *v,int am[][7],int i,int k) {     q = new node_info;     q->no = i;     push(q);     v[i] = 1;     for (int j = 0; j < 7; j++)     {         if (am[i][j] == 1 && v[j] == 0)         {             back_edges(v, am, j, i);         }         else if (am[i][j] == 0)

Reservasi Hotel C++

Gambar
#include <iostream> #include <conio> #include <string> #include <stdio> main() { char resepsionis[30], customer[30], alamat[50]; int  kamar,no_kamar,harga_kamar, ranjang ; int  biaya, total, bayar, lebih, lama, um, kurang; float diskon; string jwb, id_customer, id_resepsionis, jk,hp,  checkin, checkout; awal: cout<<"\n\t            ======================================="; cout<<"\n\t          ==========================================="; cout<<"\n\t        ==============================================="; cout<<"\n\t      ==================================================="; cout<<"\n\t    ======================================================="; cout<<"\n\t\t     SELAMAT DATANG DI HOTEL 'PASTI NGINEP' "; cout<<"\n\n\t\t     Jl. Nusa Indah no.700, telp. 0276908"; cout<<"\n\t\t    Condong catur, Depok, Sleman, Yo

Program Input Mata Pelajaran

Gambar
#include<stdio.h> int main() {    int pilihan ;    char nim, nama[30];    float ppkn, ips, ipa, ratarata;        printf("SD Petang Masuk Malam \n\n");    printf("Silahkan Pilih Menu Dibawah dengan memencet 1 sampai 5 \n");    printf("1.Input Data\n");    printf("2.Edit Data\n");    printf("3.Cetak Data\n");    printf("4.Selesai\n\n");    printf("Masukan pilihan mu (1/2/3/4) : ");    scanf("%d",&pilihan);    printf("\n\n");    switch(pilihan)    {       case 1 :           printf("PPKN  :\n"); scanf("%f",&ppkn);           printf("IPA   :\n"); scanf("%f",&ipa);     printf("IPS   :\n"); scanf("%f",&ips);   ratarata= (ppkn+ipa+ips)/3;   printf("%f",ratarata); if (ratarata>=60) { printf ("TUNTAS"); } else printf ("BELUM TUNTAS");

Program Pembelian C++

Gambar
#include<iostream> #include<conio.h> #include<stdio.h> using namespace std; main() { char nim[30],Nama[30],pembelian[10]; int jum_beli; awal: cout<<"==========================================="<<endl; cout<<"\tJAKET SERBA NYAMAN\n"; cout<<"==========================================="<<endl; cout<<"nim                  : ";cin>>nim; cout<<"Nama                  : ";cin>>Nama; cout<<"Pembelian  : ";cin>>pembelian; cout<<"Input Jumlah Beli             : ";cin>>jum_beli; cout<<"==========================================="<<endl; cout<<"\tJAKET SERBA NYAMAN \n"; cout<<"==========================================="<<endl; cout<<"nim  : "<<nim;cout<<"\tNama : "<<Nama<<endl; printf("\nPilihan