Silahkan COPAS sesuka hati anda
Dijamin 100% BISA
#include <cstdlib>
#include <iostream>
#include <string.h>
using namespace std;
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
int main(int argc, char *argv[]) {
char inmsg[1000];
int i, j, length, choice;
cout<<"Masukkan kalimat: ";
cin.getline(inmsg,100);
length=strlen(inmsg);
cout<<"Masukkan kunci : ";
cin>>choice;
for(i=0;i<length;i++){
if(isalpha(inmsg[i])){
inmsg[i]=tolower(inmsg[i]);
for(j=0;j<choice;j++){
if(inmsg[i]=='z'){
inmsg[i]='a';
}
else{
inmsg[i]++;
}
}
}
}
cout<<"Hasil Enkripsinya adalah \""<<inmsg<<"\"\"\n";
system("PAUSE");
return 0;
}
Sabtu, 01 Oktober 2016
Kamis, 22 September 2016
Koding PHP Input data, simpan, lalu menampilkan
Silahkan ketik koding ini lalu simpan dengan nama "save.php"
<html>
<form action="save.php" method="post">
<input type="text" name="Bram" placeholder="nama">
<input type="text" name="Ahmad" placeholder="alamat">
<br><input type="submit" value="simpan"></br>
</form>
<table>
<tr>
<td>Nama</td>
<td>Alamat</td>
</tr>
<?php
session_start();
if(isset($_POST['Bram'])){
$_SESSION['Bram'][$_SESSION['Dimas']][0]=$_POST['Bram'];
$_SESSION['Ahmad'][$_SESSION['Dimas']][1]=$_POST['Ahmad'];
$_SESSION['Dimas']++;
}
for($i=0;$i<$_SESSION['Dimas'];$i++){
echo "<tr><td>".$_SESSION['Bram'][$i][0]."</td>";
echo "<td>".$_SESSION['Ahmad'][$i][1]."</td></tr>";
}
?>
</table>
</html>
Setelah itu, buat koding baru lagi dengan nama "index.php"
<?php
session_start();
$_SESSION['Dimas']=0;
header("location;save.php")
?>
Outputnya
<html>
<form action="save.php" method="post">
<input type="text" name="Bram" placeholder="nama">
<input type="text" name="Ahmad" placeholder="alamat">
<br><input type="submit" value="simpan"></br>
</form>
<table>
<tr>
<td>Nama</td>
<td>Alamat</td>
</tr>
<?php
session_start();
if(isset($_POST['Bram'])){
$_SESSION['Bram'][$_SESSION['Dimas']][0]=$_POST['Bram'];
$_SESSION['Ahmad'][$_SESSION['Dimas']][1]=$_POST['Ahmad'];
$_SESSION['Dimas']++;
}
for($i=0;$i<$_SESSION['Dimas'];$i++){
echo "<tr><td>".$_SESSION['Bram'][$i][0]."</td>";
echo "<td>".$_SESSION['Ahmad'][$i][1]."</td></tr>";
}
?>
</table>
</html>
Setelah itu, buat koding baru lagi dengan nama "index.php"
<?php
session_start();
$_SESSION['Dimas']=0;
header("location;save.php")
?>
Outputnya
Kamis, 15 September 2016
Koding PHP Biodata sederhana banget
Langsung saja gan...
Cara Pertama kek gini gan:
<?php
$nama1 = "Aldi <br>";
$nama2 = "Aji <br>";
$nama3 = "Andi <br>";
$nama4 = "Ubay <br>";
$nama5 = "Imam <br>";
$alamat1 = "Medan <br>";
$alamat2 = "Papua <br>";
$alamat3 = "Kalimantan <br>";
$alamat4 = "Lampung <br>";
$alamat5 = "Sumbawa <br>";
echo "Nama = ".$nama1;
echo ' ';
echo "Alamat = ".$alamat1;
echo "Nama = ".$nama2;
echo ' ';
echo "Alamat = ".$alamat2;
echo "Nama = ".$nama3;
echo ' ';
echo "Alamat = ".$alamat3;
echo "Nama = ".$nama4;
echo ' ';
echo "Alamat = ".$alamat4;
echo "Nama = ".$nama5;
echo ' ';
echo "Alamat = ".$alamat5;
?>
Outputnya :
Cara Kedua kek gini gan:
<?php
$nama[0]="Aldi";
$nama[1]="Aji";
$nama[2]="Andi";
$nama[3]="imam";
$nama[4]="ubay";
$alamat[0]="Medan";
$alamat[1]="Papua";
$alamat[2]="kalimantan";
$alamat[3]="Sumbawa";
$alamat[4]="Lampung";
for($i=0;$i<5;$i++){
echo("<br/>Nama = $nama[$i]");
echo("<br/>Alamat = $alamat[$i]<br/>");
}
?>
Outputnya:
Cara Pertama kek gini gan:
<?php
$nama1 = "Aldi <br>";
$nama2 = "Aji <br>";
$nama3 = "Andi <br>";
$nama4 = "Ubay <br>";
$nama5 = "Imam <br>";
$alamat1 = "Medan <br>";
$alamat2 = "Papua <br>";
$alamat3 = "Kalimantan <br>";
$alamat4 = "Lampung <br>";
$alamat5 = "Sumbawa <br>";
echo "Nama = ".$nama1;
echo ' ';
echo "Alamat = ".$alamat1;
echo "Nama = ".$nama2;
echo ' ';
echo "Alamat = ".$alamat2;
echo "Nama = ".$nama3;
echo ' ';
echo "Alamat = ".$alamat3;
echo "Nama = ".$nama4;
echo ' ';
echo "Alamat = ".$alamat4;
echo "Nama = ".$nama5;
echo ' ';
echo "Alamat = ".$alamat5;
?>
Outputnya :
<?php
$nama[0]="Aldi";
$nama[1]="Aji";
$nama[2]="Andi";
$nama[3]="imam";
$nama[4]="ubay";
$alamat[0]="Medan";
$alamat[1]="Papua";
$alamat[2]="kalimantan";
$alamat[3]="Sumbawa";
$alamat[4]="Lampung";
for($i=0;$i<5;$i++){
echo("<br/>Nama = $nama[$i]");
echo("<br/>Alamat = $alamat[$i]<br/>");
}
?>
Outputnya:
Cara ketiga begini:
<?php
$nama=array("Aji","Aldi","Imam","Andi");
$alamat=array("Papua","Medan","Sumbawa","Kalimantan");
for($i=0;$i<=3;$i++){
echo("<br/>Nama = $nama[$i]");
echo("<br/>Alamat = $alamat[$i]");
}
?>
Outputnya:
Minggu, 28 Juni 2015
Konversi detik ke Jam, Menit dan Detik
Program Konversi detik ke Jam, Menit dan Detik dengan DEV C++
#include <iostream>
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
using namespace std;
int main(int argc, char** argv) {
double a,b,c,d;
cout<<"Masukkan nilai jam dalam detik = ";cin>>a;
b=a/3600;
c=a/60;
d=a/1;
cout<<b<<"Jam "<<c<<"Menit "<<d<<"Detik";
return 0;
}
#include <iostream>
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
using namespace std;
int main(int argc, char** argv) {
double a,b,c,d;
cout<<"Masukkan nilai jam dalam detik = ";cin>>a;
b=a/3600;
c=a/60;
d=a/1;
cout<<b<<"Jam "<<c<<"Menit "<<d<<"Detik";
return 0;
}
Wujud Air
Program Wujud Air dengan DEV C++
#include <iostream>
#include <cstdlib>
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
using namespace std;
int main(int argc, char** argv) {
float A;
cout<<"Masukkan suhu air dalam Celcius = ";cin>>A;
if ((A>=0) && (A<=100))
cout<<"Wujudnya cair";
else if (A>100)
cout<<"Wujudnya uap";
else
cout<<"Wujudnya padat";
cout<<endl;
system("PAUSE");
return 0;
}
#include <iostream>
#include <cstdlib>
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
using namespace std;
int main(int argc, char** argv) {
float A;
cout<<"Masukkan suhu air dalam Celcius = ";cin>>A;
if ((A>=0) && (A<=100))
cout<<"Wujudnya cair";
else if (A>100)
cout<<"Wujudnya uap";
else
cout<<"Wujudnya padat";
cout<<endl;
system("PAUSE");
return 0;
}
Deret Fibonacci
Deret Fibonacci dengan DEV C++
#include <iostream>
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
using namespace std;
int main(int argc, char** argv) {
int a, b, c, d, e;
cout<<"Deret Fibonacci\n";
cout<<"Masukkan bilangan : ";cin>>a;
c=1;d=1;
cout<<c<<endl<<d<<endl;
for(int b=3; b<=a; b++)
{
e = c + d;
c = d;
d = e;
cout<<e<<endl;
}
return 0;
}
Deret Fibonacci dengan Pascal
#include <iostream>
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
using namespace std;
int main(int argc, char** argv) {
int a, b, c, d, e;
cout<<"Deret Fibonacci\n";
cout<<"Masukkan bilangan : ";cin>>a;
c=1;d=1;
cout<<c<<endl<<d<<endl;
for(int b=3; b<=a; b++)
{
e = c + d;
c = d;
d = e;
cout<<e<<endl;
}
return 0;
}
Deret Fibonacci dengan Pascal
Tukar 3 Bilangan
Program Tukar 3 Bilangan dengan DEV C++
#include <iostream>
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
using namespace std;
int main(int argc, char** argv) {
int A=5, B=2, C=3, D;
cout<<"A = "<<endl;cin>>A;
cout<<"B = "<<endl;cin>>B;
cout<<"C = "<<endl;cin>>C;
D=A;
A=B;
B=C;
C=D;
cout<<endl;
cout<<"A = "<<A<<endl;
cout<<"B = "<<B<<endl;
cout<<"C = "<<C<<endl;
return 0;
}
Program Tukar 3 Bilangan dengan Pascal
#include <iostream>
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
using namespace std;
int main(int argc, char** argv) {
int A=5, B=2, C=3, D;
cout<<"A = "<<endl;cin>>A;
cout<<"B = "<<endl;cin>>B;
cout<<"C = "<<endl;cin>>C;
D=A;
A=B;
B=C;
C=D;
cout<<endl;
cout<<"A = "<<A<<endl;
cout<<"B = "<<B<<endl;
cout<<"C = "<<C<<endl;
return 0;
}
Program Tukar 3 Bilangan dengan Pascal
Langganan:
Postingan (Atom)




