#include<iostream.h>
#include<conio.h>
void input();
void output();
void main () {
int pil;
do {
clrscr(); cout<<" Menu ";
cout <<endl<<"1. Input Data";
cout <<endl<<"2. Output Data";
cout <<endl<<"3. Pilihan : ";
cin>>pil;
switch (pil){
case 0 : input(); break;
case 1 : output(); break;
}
}while (pil !=3);
}
void input(){
cout<<"Bagin input ! "; getch();
}
void output(){
cout<<"Bagin Output ! "; getch();
}
NURUL BLOG
Minggu, 03 Juli 2011
#include<iostream.h>
#include<conio.h>
#include<string.h>
void main()
{
int kode[10];
int i; char nama [20]; long harga;
for (i=0; i<10; i++)
{
gotoxy(60,i);cout<<"kode :" ;cin>>kode[i];
}
gotoxy(10,3);cout<<" - - - - - - - - - - - - - -";
gotoxy(10,4);cout<<" Kode jabatan Gaji Tunjangan ";
gotoxy(10,5); cout<<" __________________________";
for(i=0; i<10; i++){
if (kode[i]==1){
strcpy(tunj,"35%");
gaji= 2500000;
}else if(kode[i]==2){
strcpy (tunj, "10%");
harga=2000000;
} else if(kode[i]==3){
strcpy (tunj,"5%");
harga=150000;
} else strcpy(nama, "_ _");
{
#include<conio.h>
#include<string.h>
void main()
{
int kode[10];
int i; char nama [20]; long harga;
for (i=0; i<10; i++)
{
gotoxy(60,i);cout<<"kode :" ;cin>>kode[i];
}
gotoxy(10,3);cout<<" - - - - - - - - - - - - - -";
gotoxy(10,4);cout<<" Kode jabatan Gaji Tunjangan ";
gotoxy(10,5); cout<<" __________________________";
for(i=0; i<10; i++){
if (kode[i]==1){
strcpy(tunj,"35%");
gaji= 2500000;
}else if(kode[i]==2){
strcpy (tunj, "10%");
harga=2000000;
} else if(kode[i]==3){
strcpy (tunj,"5%");
harga=150000;
} else strcpy(nama, "_ _");
{
Sabtu, 02 Juli 2011
persiapan quis
hemmmmmmmmm........
malam minggu,ngerjai tugas quiss..
rame dgn anak2 yang maen pb..
hehehehe
malam minggu,ngerjai tugas quiss..
rame dgn anak2 yang maen pb..
hehehehe
input
#include<iostream.h>
#include<conio.h>
void input();
void output();
void main () {
int pil;
do {
clrscr(); cout<<" Menu ";
cout <<endl<<"1. Input Data";
cout <<endl<<"2. Output Data";
cout <<endl<<"3. Pilihan : ";
cin>>pil;
switch (pil){
case 0 : input(); break;
case 1 : output(); break;
}
}while (pil !=3);
}
void input(){
cout<<"Bagin input ! "; getch();
}
void output(){
cout<<"Bagin Output ! "; getch();
}
#include<conio.h>
void input();
void output();
void main () {
int pil;
do {
clrscr(); cout<<" Menu ";
cout <<endl<<"1. Input Data";
cout <<endl<<"2. Output Data";
cout <<endl<<"3. Pilihan : ";
cin>>pil;
switch (pil){
case 0 : input(); break;
case 1 : output(); break;
}
}while (pil !=3);
}
void input(){
cout<<"Bagin input ! "; getch();
}
void output(){
cout<<"Bagin Output ! "; getch();
}
minimaxra
#include <iostream.h>
#include <stdio.h>
#include <conio.h>
#include <math.h>
void input(int x[],int n)
{
for (int i=1;i<=n;i++)
{cout<<"Masukan Nilai "<<i<<" : ";cin>>x[i];}
}
void tinggi(int x[],int n)
{
int max,min;
max = x[1];
min = x[1];
for (int i=2;i<=n;i++)
{
if (max < x[i])
max = x[i];
if (min > x[i])
min = x[i];
}
cout<<"\nNilai tertinggi = "<<max<<"\n";
cout<<"Nilai terendah = "<<min<<"\n";
}
double rata(int x[],int n)
{
double a,b;
a = 0;
for (int i=1;i<=n;i++)
{
a = a + x[i];
}
b = a/n;
cout<<"Rata-Rata : "<<a<<"/"<<n<<" = "<<b;
}
void main()
{
int p[50],N;
cout<<"Banyaknya Data : ";cin>>N;
cout<<endl;
input(p,N);
tinggi(p,N);
rata (p,N);
getch();
}
#include <stdio.h>
#include <conio.h>
#include <math.h>
void input(int x[],int n)
{
for (int i=1;i<=n;i++)
{cout<<"Masukan Nilai "<<i<<" : ";cin>>x[i];}
}
void tinggi(int x[],int n)
{
int max,min;
max = x[1];
min = x[1];
for (int i=2;i<=n;i++)
{
if (max < x[i])
max = x[i];
if (min > x[i])
min = x[i];
}
cout<<"\nNilai tertinggi = "<<max<<"\n";
cout<<"Nilai terendah = "<<min<<"\n";
}
double rata(int x[],int n)
{
double a,b;
a = 0;
for (int i=1;i<=n;i++)
{
a = a + x[i];
}
b = a/n;
cout<<"Rata-Rata : "<<a<<"/"<<n<<" = "<<b;
}
void main()
{
int p[50],N;
cout<<"Banyaknya Data : ";cin>>N;
cout<<endl;
input(p,N);
tinggi(p,N);
rata (p,N);
getch();
}
jumlah rata2
#include<iostream.h>
#include<conio.h>
d
void main()
{
float n,total,rata2;
total=0;
for (int i=0; i<10; i++)
{
cout<<"masukan nilai ke"<<(i+1)<<":";
cin>>n;
total=total+n;
}
rata2=total/10;
cout<<"total="<<total<<endl;
cout<<"rata2="<<rata2<<endl;
getch();
}
#include<conio.h>
d
void main()
{
float n,total,rata2;
total=0;
for (int i=0; i<10; i++)
{
cout<<"masukan nilai ke"<<(i+1)<<":";
cin>>n;
total=total+n;
}
rata2=total/10;
cout<<"total="<<total<<endl;
cout<<"rata2="<<rata2<<endl;
getch();
}
pangkat
#include<iostream.h>
#include<stdio.h>
#include<conio.h>
#include<math.h>
void main()
{
int x,y;
float z;
clrscr();
cout<<"Menghitung x pangkat y\n";
cout<<"Input Biangan : ";
cin>> x;
cout<<"Input Pangkat : ";
cin>> y;
cout<< x <<" dipangkatkan dengan "<< y <<" adalah " <<pow(x,y);
getch(); clrscr();
cout<<"Menghitung akar suatu bilangan z\n";
cout<<"Input Bilangan z : ";
cin>> z;
cout<<"Akar dari "<<z<<" adalah "<<sqrt(z);
getch();
}
#include<stdio.h>
#include<conio.h>
#include<math.h>
void main()
{
int x,y;
float z;
clrscr();
cout<<"Menghitung x pangkat y\n";
cout<<"Input Biangan : ";
cin>> x;
cout<<"Input Pangkat : ";
cin>> y;
cout<< x <<" dipangkatkan dengan "<< y <<" adalah " <<pow(x,y);
getch(); clrscr();
cout<<"Menghitung akar suatu bilangan z\n";
cout<<"Input Bilangan z : ";
cin>> z;
cout<<"Akar dari "<<z<<" adalah "<<sqrt(z);
getch();
}
Langganan:
Postingan (Atom)